Not sure if this would help, but you can first to a terms facet/aggregation
on user_id, then you pull back the top 3 ids, say user5, user7, and user20.
Then you run a second query using the _msearch API wherein you construct
three independent search queries (one for each user) and you will get
In multi search, you mean use 5, 7, 20 (user5, user7, and user20) to indicate
user id for routing and then pick top 2 products for each of them?
I use Play Framework and Scala, do you know how to embed the facet term
results (user id) into the multi search? (As far as I know in ES Java APIs,
it
What about nested or parent/child query? How to achieve?
On Thursday, May 8, 2014 4:45:36 PM UTC-7, Yao Li wrote:
I have a collection of products which belong to few users, like
[
{ id: 1, user_id: 1, description: blabla..., ... },
{ id: 2, user_id: 2, description: blabla..., ...