Skip to content

Conversation

@jimczi
Copy link
Contributor

@jimczi jimczi commented Jan 7, 2019

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

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
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-analytics-geo

@polyfractal polyfractal self-requested a review January 15, 2019 14:06
Copy link
Contributor

@polyfractal polyfractal left a 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) {
Copy link
Contributor

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?

Copy link
Contributor Author

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.

@jimczi jimczi merged commit cb451ed into elastic:master Jan 25, 2019
@jimczi jimczi deleted the composite_with_nested_parent branch January 25, 2019 13:00
jimczi added a commit that referenced this pull request Jan 25, 2019
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
@krishan-21723
Copy link

why can't it support all kinds of aggregators as parent ?

@edoquiros
Copy link

edoquiros commented Feb 17, 2020

Starting on which version is this feature available?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

composite aggregation as child aggregation

6 participants