Closed as not planned
Closed as not planned
Description
When a script is not a value script in a terms aggregation then the request must not contain the "fields" parameter.
However, there is no warning to the user if the request has the "fields" parameter anyway. The aggregation will just fail with cryptic error messages or even worse just silently not do the right thing.
This fails with an ArrayIndexOutOfBoundsException:
{
"aggs": {
"2": {
"terms": {
"field": "label",
"script": "doc['label'].value"
}
}
}
}
This silently just does not do the right thing (returns one bucket with key 0 and all docs in it):
{
"aggs": {
"2": {
"terms": {
"field": "label",
"script": "_index['text']['the'].tf()"
}
}
}
}