New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Aggregations: ClassCastException when sibling aggregations have the same name #6255
Comments
+1 I'll work on that |
When referring to another aggregation (eg. for sorting the buckets of a terms aggregation), you need to specify the relative path from the current aggregation to the one that is used for sorting, so there should be no ambiguity. Or were you thinking about something else? |
No, that is what I was thinking of, so its just a problem for sibling aggregations then |
If I run a search query of the following kind:
It causes a ClassCastException in Elasticsearch:
It looks like it is actually combining all aggregations with the same name into one combined aggregation. The error occurs when the fields in the two aggregations are different types but will also give strange results when they are both the same type. I have so far only tried this with the Terms aggregation but I suspect it will be an issue for other types too.
There should probably be some validation of sibling aggregations to ensure they have unique names and throw back a parse error to the client if there are multiple sibling aggregations with the same name.
More than this, since aggregations can be referenced from other aggregations by name, should aggregations names be unique across all aggregations and not just within their siblings?
The text was updated successfully, but these errors were encountered: