Hi David Thank you for your reply, so based on your suggestion I should maintain a document (e.g. user) with some aggregated values and I should update it as we move along with our indexing of our data, correct?
This though would only give me totals. I cannot apply something like a range. I found as well a similar discussion here https://groups.google.com/forum/#!msg/elasticsearch/UsrCG2Abj-A/IDO9DX_PoQwJ. Maybe something similar with the terms and histogram aggregation could support this logic like instead of giving : { "aggs" : { "requests_distribution" : { "distribution" : { "field" : "user_id", "interval" : 50 } } } } and the result could be: { "aggregations": { "requests_distribution" : { "buckets": [ { "key": 0, "doc_count": 2 }, { "key": 50, "doc_count": 400 }, { "key": 150, "doc_count": 30 } ] } } } Where the key represents a unique number of users like for 0 to 50 users have 2 documents per user etc. Just an idea Thanks Thomas On Tuesday, 24 June 2014 13:32:13 UTC+3, Thomas wrote: > > Hi, > > I wanted to ask whether it is possible to get with the aggregation > framework the distribution of one specific type of documents sent per user, > I'm interested for occurrences of documents per user, e.g. : > > 1000 users sent 1 document > 500 ussers sent 2 documents > X number of unique users sent Y documents (each) > etc. > > on each document i index the user_id > > Is there a way to support such a query, or partially support it? get the > first 10 rows of this type of list not the exhaustive list. Can you give me > some hint? > > Thanks > -- You received this message because you are subscribed to the Google Groups "elasticsearch" group. To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/ae8b56f1-a783-4ade-b948-079f6457ae27%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.