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

Add "size" parameter to historgram aggregation (limit number of returned results) #7103

Closed
rore opened this issue Jul 31, 2014 · 4 comments
Closed
Assignees
Labels

Comments

@rore
Copy link

rore commented Jul 31, 2014

It would be very helpful to be able to limit the number of returned results for histogram and date histogram aggregations.

Example use case: collecting requests logs in Elasticsearch. You want to see the maximum req/sec rate over the last hour (or whatever time period). Using aggregations it's easy to use date histogram with a second interval, sort by doc count and get the top second with most requests. But as the time period you query over is bigger, the response size becomes huge (and if on top of that you have a parent bucket - like histogram per request type - it's even worse). It's very wasteful to get the entire histogram results which consumes a lot of network and high latency when all you need are the top couple of buckets.

@jpountz jpountz self-assigned this Jul 31, 2014
@clintongormley
Copy link

i think this would be handled by #2040, no?

@colings86
Copy link
Contributor

Would also be handled by #6704

@jpountz
Copy link
Contributor

jpountz commented Jul 31, 2014

I am not sure the histogram aggregation should support a size parameter in the same way as terms do. This aggregation is already selective in the sense that the number of buckets is manageable through the interval (whereas for terms you depend on the cardinality of your fields). Moreover, this would expose histograms to the same accuracy challenges as terms. I think such a feature would be better addressed by adding the ability to perform some post-processing on top of the reduced aggregation?

@clintongormley
Copy link

Closed in favour of #8110

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants