Hi I think you need field collapsing, look here
http://wiki.apache.org/solr/FieldCollapsing 2009/11/24 Tomasz Kępski <tom...@kepski.pl> > Hi, > > I have the following case: > > In my index I do have documents categorized (category_id - int sortable > field). I would like to get three top documents matching user query BUT each > have to be from different category.: > > for example from returned set (doc_id : category id): > > 1:1 > 2:1 > 3:1 > 4:2 > 5:1 > 6:2 > 7:3 > 8:4 > > I would like to get docs 1, 4 and 7. > Is that possible without quering 3 times? Often lot of (more than my limit) > the docs at the beginning are from the same category. > I'm using PHP Apache Solr so I would like to avoid processing large sets of > data in my PHP based application. > > Tomek > -- Andrew Klochkov Senior Software Engineer, Grid Dynamics