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
Aggregations: Histogram Aggregation key Bug #6655
Comments
There is currently no way to disable
I am not sure to get what you mean. The Java API already has hash-like access to the buckets via the |
this is a bug... the |
Thanks jpountz for having format my post ;) I meant it's not possible to ask ES for a JSON like this : {
"aggregations": {
"prices": {
"buckets": {
"0": {
"key": 0,
"doc_count": 2
},
"50": {
"key": 50,
"doc_count": 4
},
"150": {
"key": 150,
"doc_count": 3
}
}
}
}
} Yes it's possible to access the Json with getBucketByKey but the JSON is like this : {
"aggregations": {
"prices" : {
"buckets": [
{
"key_as_string" : "0",
"key": 0,
"doc_count": 2
},
{
"key_as_string" : "50",
"key": 50,
"doc_count": 4
},
{
"key_as_string" : "150",
"key": 150,
"doc_count": 3
}
]
}
}
} Furthermore if it's a bug, why close that post? |
Because this post is still open, and the closed post is a duplicate. |
Oups... My Bad.... :s |
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
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
The key as string field in the response for the histogram aggregation will now only show if format is specified on the request. Closes elastic#6655
Hi,
I'm working with histogram aggregation but there is something strange with keys.
For instance (cf : http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-aggregations-bucket-histogram-aggregation.html):
If I use this request :
I obtain something like this :
Instead of :
You could say, it's not important but it generates json ~1/3 bigger...
Is there a mean to disable this ???
Moreover, in Elasticsearch Java API, it could be fine to have a method to request the response as a hash instead keyed by the buckets keys (cf :http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-aggregations-bucket-histogram-aggregation.html#_response_format)
Thanks!!!
The text was updated successfully, but these errors were encountered: