Reputation: 25269
I want to do a field collapse top hits aggregation, exactly as documented here:
In particular, this segment is a problem:
"top_hit": {
"max": {
"script": "_score"
}
}
Because the production environment is configured with:
script.disable_dynamic: sandbox
Which means I can't use groovy scripts, without getting an error along these lines:
nested: ScriptException[dynamic scripting for [groovy] disabled];
If I change the query like so:
"top_hit": {
"max": {
"lang": "expression",
"script": "_score"
}
}
I get a different type of error:
nested: IllegalStateException[Expressions referencing the score can only be used for sorting];
The elastic search version is 1.5.2. Is there a way to do what I want (with lucene expressions)?
Upvotes: 1
Views: 458
Reputation: 25269
I found the answer after a little bit of googling. This was a known issue which was fixed.
https://github.com/elastic/elasticsearch/issues/10091
It's unclear which version it is fixed in, however.
Upvotes: 0