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

Fixed Histogram key_as_string bug #6830

Closed
wants to merge 0 commits into from

Conversation

Projects
None yet
4 participants
@colings86
Copy link
Member

colings86 commented Jul 11, 2014

The key as string field in the response for the histogram aggregation will now only show if format is specified on the request.

Closes #6655

@colings86 colings86 added the review label Jul 11, 2014

@rnonnon-ebiz

This comment has been minimized.

Copy link

rnonnon-ebiz commented Jul 15, 2014

Hi,
Thanks, but that "semi-fix" the problem because Elasticsearch core return the key_as_string, then if you don't use the JAVA API, the problem is still here. Moreover, the JSON returned from Elasticsearch to the JAVA API is still ~1/3 too big.

@s1monw

This comment has been minimized.

Copy link
Contributor

s1monw commented Jul 15, 2014

@colings86 can we have a test for this too?

@s1monw s1monw removed the review label Jul 15, 2014

@colings86

This comment has been minimized.

Copy link
Member Author

colings86 commented Jul 16, 2014

@rnonnon I'm not sure I fully understand what you mean. After this change is merged, if you don't specify the format parameter on the histogram aggregation, the `key_as_string' field will not be present in the JSON response and the response will resemble the following:

...
"aggregations": {
      "test": {
         "buckets": [
            {
               "key": 450,
               "doc_count": 23
            },
            {
               "key": 500,
               "doc_count": 2452
            },
            {
               "key": 550,
               "doc_count": 12430
            },
            {
               "key": 600,
               "doc_count": 14982
            },
            {
               "key": 650,
               "doc_count": 13951
            }
            ...

This change does not affect the Java API as the serialisation to the Transpoort layer already does not serialise the key as a string

@colings86

This comment has been minimized.

Copy link
Member Author

colings86 commented Jul 16, 2014

@s1monw added a rest test to check the JSON output both with and without the format parameter specified

@s1monw

This comment has been minimized.

Copy link
Contributor

s1monw commented Jul 16, 2014

LGTM

@colings86 colings86 closed this Jul 16, 2014

@colings86

This comment has been minimized.

Copy link
Member Author

colings86 commented Jul 16, 2014

merged but did not auto-close

@colings86 colings86 self-assigned this Aug 21, 2014

@colings86 colings86 deleted the colings86:fix/6655 branch Aug 21, 2014

@clintongormley clintongormley changed the title Aggregations: Fixed Histogram key_as_string bug Fixed Histogram key_as_string bug Jun 7, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.