elasticsearch - elastic search top_hits aggregation with lucene expression -


i want field collapse top hits aggregation, documented here:

https://www.elastic.co/guide/en/elasticsearch/reference/current/search-aggregations-metrics-top-hits-aggregation.html#_field_collapse_example

in particular, segment problem:

"top_hit": {     "max": {         "script": "_score"     } } 

because production environment configured with:

script.disable_dynamic: sandbox 

which means can't use groovy scripts, without getting error along these lines:

nested: scriptexception[dynamic scripting [groovy] disabled]; 

if change query so:

"top_hit": {     "max": {         "lang": "expression",         "script": "_score"     } } 

i different type of error:

nested: illegalstateexception[expressions referencing score can used sorting]; 

the elastic search version 1.5.2. there way want (with lucene expressions)?

i found answer after little bit of googling. known issue fixed.

https://github.com/elastic/elasticsearch/issues/10091

it's unclear version fixed in, however.


Comments