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" : "not_analyzed",
"type" : "string"
}
}
}
I want to find the number of (unique) user_ids that have X number of
documents, e.g. for country US, and ideally I need the full list e.g.:
1000 users have 43 documents
..
100 users have 234 documents
150 users have 500 documents
etc..
In other words the distribution of documents (requests) per unique user
count, of course I can understand that it is a pretty heavy operation in
terms of memory, but we may limit to the top 100 rows for instance, or if
we can workaround it.
Thanks again for your time
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 [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/elasticsearch/e07561ed-7f1b-4e98-8a8d-16e410324cc2%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.