Allow aggregations_binary to build and parse #11473
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Previously AggregationBuilder would wrap binary_aggregations in an aggregations object which would break parsing. This has been fixed so that for normally specified aggregations there are wrapped in an
aggregations
object, for binary aggregation which have the same XContentType as the builder it will use anaggregations
field name and use the aggregationsBinary as the value (this will render the same as normal aggregations), and for binary aggregation with a different ContentType from the builder we use anaggregations_binary
field name and add the aggregationsBinary as a binary value.Additionally the logic in AggregationParsers needed to be changed as it previously did not parse
aggregations_binary
fields in sub-aggregations. A check has been added for theaggregations_binary
field name and the binaryValue of this field is used to create a new parser and create the correct AggregatorFactories.Close #11457