You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The current implementation of the histogram aggregation requires an interval field to specify the histogram bucket size. Providing an appropriate interval requires additional knowledge about the data set, usually the min and max. This additional knowledge can be obtained from Elasticsearch but requires additional HTTP traffic and adds unnecessary complexity to client implementations.
I recommend adding a new parameter, buckets, to the histogram aggregation. Elasticsearch would use this value to automatically calculate an appropriate interval that generates the specified number of buckets taking into consideration all provided queries, filters, and aggregation filters.
As @nreese mentioned we could accomplish this by issuing two requests from the client, the first grabbing the min/max values for the given field. But since the aggregation may have a search query and/or filters associated with it we don't know how performant this would be. I imagine it would be more efficient to implement this option inside elasticsearch so the calculations can be done in a single request.
I think there's some precedence for such an option in the terms agg. Essentially we want the size option from the terms agg, but for histograms.
The current implementation of the histogram aggregation requires an interval field to specify the histogram bucket size. Providing an appropriate interval requires additional knowledge about the data set, usually the min and max. This additional knowledge can be obtained from Elasticsearch but requires additional HTTP traffic and adds unnecessary complexity to client implementations.
I recommend adding a new parameter, buckets, to the histogram aggregation. Elasticsearch would use this value to automatically calculate an appropriate interval that generates the specified number of buckets taking into consideration all provided queries, filters, and aggregation filters.
The text was updated successfully, but these errors were encountered: