Aggregation Framework, possible to get distribution of requests per user

2014-06-24 Thread Thomas
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

Re: Aggregation Framework, possible to get distribution of requests per user

2014-06-24 Thread David Pilato
Imagine that you have indexed users. User has a numberOfDocs field. You can build a range aggregation on top of that and gives back the count for buckets like: numberOfDocs 2 1 numberOfDocs 3 … See 

Re: Aggregation Framework, possible to get distribution of requests per user

2014-06-24 Thread Thomas
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

Re: Aggregation Framework, possible to get distribution of requests per user

2014-06-24 Thread David Pilato
I was only thinking loud. I mean that I don't know what your model looks like. May be you could illustrate your use case with some actual data and we can move forward from here? What kind of documents are you actually indexing and searching for? What fields do you have? --  David Pilato | 

Re: Aggregation Framework, possible to get distribution of requests per user

2014-06-24 Thread Thomas
My mistake sorry, Here is an example: I have the request document: request:{ dynamic : strict, properties : { time : { format : dateOptionalTime, type : date }, user_id : { index : not_analyzed, type : string }, country : { index :