Hello, everyone.
I have a problem regarding a scripted terms aggregation that no longer works since ES 5.X.
I need a terms aggregation on two multivalued fields.
In groovy, I used to do this :
doc['field1'].values + doc['field2'].values
But in Painless, when executing that script, I get
Cannot apply[ + ]operation to types[org.elasticsearch.index.fielddata.ScriptDocValues.Strings]and[org.elasticsearch.index.fielddata.ScriptDocValues.Strings]
This is pretty self explanatory. The problem is that I cannot find anywhere in the doc how I sould proceed.
Concerning that use case, the documentation simply state to "use a script to get the infos from several fields" but do not go on to explain how.
How can it be done?
Thanks.