I don't get it, if b and d only have 4 products, how can you fetch one more for them?
But any way, if you realy know what you are doing, then I can say that this is quite specific, so you may have to do it in 2 solr queries. also see the Grouping Componant, it may help you get what you want (grouping by the category field) http://wiki.apache.org/solr/FieldCollapsing 2013/12/30 nish <nishantsharma...@gmail.com> > I am using solr 4.4.0. The search is performed on products, each of which > has > a category field. I want to retrieve top n products. But, if some category > has less than m products among the top n, then I want to retrieve more > products only for those categories. > > Eg. I have 4 categories a, b, c, d. n=20 and m=5. Now lets say the top > 20(=n) have following category distribution (a:6, b:4, c:6, d:4). > Categories > b and d have less than m(=5) products. So I would like to fetch one more > product(with the next highest score) for both these categories. > > Is there a way I can do this using solr > > > > -- > View this message in context: > http://lucene.472066.n3.nabble.com/Fetching-results-with-a-minimum-from-each-category-tp4108659.html > Sent from the Solr - User mailing list archive at Nabble.com. >