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
Closed

Fixed Histogram key_as_string bug #6830

wants to merge 0 commits into from

Conversation

colings86
Copy link
Contributor

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

@rnonnon-ebiz
Copy link

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
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
Copy link
Contributor Author

@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
Copy link
Contributor Author

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

@s1monw
Copy link
Contributor

s1monw commented Jul 16, 2014

LGTM

@colings86 colings86 closed this Jul 16, 2014
@colings86
Copy link
Contributor Author

merged but did not auto-close

@colings86 colings86 self-assigned this Aug 21, 2014
@colings86 colings86 deleted the fix/6655 branch August 21, 2014 15:11
@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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Aggregations: Histogram Aggregation key Bug
4 participants