Distribute Search Results across a specific field / property

Hi Guys,

I am using ES to build out the search for an online store. The operator
would like to have the results being returned in a way that showcases the
varieties of manufactures he offers. So instead of returning order by
score he would like there to be one result from each store on each page, at
least on the first few pages.
The issue is there is one manufactures who makes 80% of the portfolio so it
always looks like there is only that one store.
But if one could "mix" or "distribute" the results to showcase the variety
that be pretty cool.
I have seen a bunch of online stores do that somehow, although I do not
know how.

Is there a way to use ES to somehow do a query like, return 20 results and
2 of each Store?

Thanks for your help.

Frederik

--
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+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/5e3f3787-79a5-4481-908a-0c2092da31ea%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

I have a pull request in the works that adds an option for maintaining
diversity in results: Sampler aggregation by markharwood · Pull Request #10221 · elastic/elasticsearch · GitHub
This is mainly for the purposes of sample-based aggregations but if used
with the top_hits aggregation it might give you some of what you need.

Cheers
Mark

On Monday, April 20, 2015 at 3:18:49 PM UTC+1, Frederik Lipfert wrote:

Hi Guys,

I am using ES to build out the search for an online store. The operator
would like to have the results being returned in a way that showcases the
varieties of manufactures he offers. So instead of returning order by
score he would like there to be one result from each store on each page, at
least on the first few pages.
The issue is there is one manufactures who makes 80% of the portfolio so
it always looks like there is only that one store.
But if one could "mix" or "distribute" the results to showcase the variety
that be pretty cool.
I have seen a bunch of online stores do that somehow, although I do not
know how.

Is there a way to use ES to somehow do a query like, return 20 results and
2 of each Store?

Thanks for your help.

Frederik

--
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+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/feaece21-85c0-405c-8eda-77d627f74bb1%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.