Question

I have a solr schema which contains few index fields

Now i have different types of products which are distinguished by 'type' field. I want max 50 search results per search request.But the results should contain at least 5 products of each type, if they are part of the search.Say if i search for computer hardware store products, my search result should contain 5 HDDs,5 RAMs,5 CPUs,5 Mother boards etc. if these products are result of search.

In case if total returned rows for certain product type are less then 5, include what ever rows are available.

I have tried facet query and clustering, but could not succeeded.

Any ideas ? How to achieve this ?

Was it helpful?

Solution

Check Solr field Collapsing which will allows you to group results by product type.
Also, you can control the number of groups to be returned and number of entries in per group.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top