Using version 6.4.2.
I have created a dashboard which contains multiple normal fields and scripted fields.
On scripted fields, filtering works correctly; Standard filter queries are automatically created:
{ "query": { "match": { "dossier.label.raw": { "query": "ADVN", "type": "phrase" } } } }
However, when using a scripted field, the filter query does not work and never yields any results. This is an example of an automatically created filter query on a scripted field:
{ "script": { "script": { "inline": "boolean compare(Supplier s, def v) {return s.get() == v;}compare(() -> { doc['dossier.label.raw'] }, params.value);", "lang": "painless", "params": { "value": "ADVN" } } } }
When I manually correct this query to a standard filter query, the filtering actually works on scripted fields.
How can I get filtering to work out-of-the-box on scripted fields?