I would like to use a script to do the following:
{
"query": {
"match_all": {}
},
"facets": {
"user_facet": {
"terms": {
"field": "user_id",
"script": "term + \"_\" + _source.code"
}
}
}
}
This is similar to the answer given in this question: elastic search double facet
The only problem I have is my user_id and code fields are long types, rather than strings. Is there a way to make them strings so they can be combined with the script?
The particular error I am getting is this:
nested: ClassCastException[java.lang.String cannot be cast to java.lang.Number];