Navigation Menu

Skip to content
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 aggregations_binary to build and parse #11473

Merged
merged 1 commit into from Jun 4, 2015
Merged

Allow aggregations_binary to build and parse #11473

merged 1 commit into from Jun 4, 2015

Conversation

colings86
Copy link
Contributor

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 an aggregations 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 an aggregations_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 the aggregations_binary field name and the binaryValue of this field is used to create a new parser and create the correct AggregatorFactories.

Close #11457

@jpountz
Copy link
Contributor

jpountz commented Jun 4, 2015

LGTM

Maybe we should stop supporting this aggregations_binary thing. I assume it was added because facets had it too but if we are only finding about this bug now, it probably does not have enough usage to be worth supporting?

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 an `aggregations` 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 an `aggregations_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 the `aggregations_binary` field name and the binaryValue of this field is used to create a new parser and create the correct AggregatorFactories.

Close #11457
@colings86 colings86 merged commit 39a20c3 into elastic:master Jun 4, 2015
@kevinkluge kevinkluge removed the review label Jun 4, 2015
@colings86 colings86 deleted the fix/11457 branch June 4, 2015 12:12
@clintongormley clintongormley changed the title Aggregations: Allow aggregations_binary to build and parse Allow aggregations_binary to build and parse Jun 7, 2015
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.

AggregationBuilder renders incorrect JSON when using binary or raw sub-aggregation
3 participants