-
Notifications
You must be signed in to change notification settings - Fork 25.1k
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
Allow nested fields in the composite aggregation #37178
Conversation
This changes adds the support to handle `nested` fields in the `composite` aggregation. A `nested` aggregation can be used as parent of a `composite` aggregation in order to target `nested` fields in the `sources`. Closes elastic#28611
Pinging @elastic/es-analytics-geo |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, sorry for the delay!
if (parent != null) { | ||
throw new IllegalArgumentException("[composite] aggregation cannot be used with a parent aggregation"); | ||
AggregatorFactory<?> invalid = checkParentIsNullOrNested(parent); | ||
if (invalid != null) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Out of curiosity, what scenario might trigger this now that nested is supported?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you add a parent other than a nested
aggregator. So for instance a terms
aggregation cannot use a composite
aggregation as a sub-aggregation.
This changes adds the support to handle `nested` fields in the `composite` aggregation. A `nested` aggregation can be used as parent of a `composite` aggregation in order to target `nested` fields in the `sources`. Closes #28611
why can't it support all kinds of aggregators as parent ? |
A composite aggregation should be allowed to be a grandchild of a nested aggregation only if it's parent is a filter aggregation. Relates to elastic#37178
Starting on which version is this feature available? |
This changes adds the support to handle
nested
fields in thecomposite
aggregation. A
nested
aggregation can be used as parent of acomposite
aggregation in order to target
nested
fields in thesources
.Closes #28611