Hi,
After upgrading to elastic search 5.4, script with terms aggregation giving compile error which were working properly in previous version 2.3.
I am getting compile error for "list.location" aggregation.
Below is the code snippet for your reference.
GET myindex/mytype/_search
{
"_source": ["id","title","location","country"],
"query": {
something...
},
"aggs":{
"list.location":{
"terms":{
"script": "result=; country = doc['country.untouched'].value + '##'; if (doc['location.untouched'].empty) {country + 'null';} else {for(term in doc['location.untouched'].values){result.add(country + term)}; return result}"
}
}
}
}
Below is attached error screenshot.
Can you please help me to find solution for this..
Thanks