Field Collapsing (currently as patch) is exactly what you're looking for imo.
http://wiki.apache.org/solr/FieldCollapsing <http://wiki.apache.org/solr/FieldCollapsing>Geert-Jan 2010/8/4 Ken Krugler <kkrugler_li...@transpac.com> > Hi all, > > I've got a situation where the key result from an initial search request > (let's say for "dog") is the list of values from a faceted field, sorted by > hit count. > > For the top 10 of these faceted field values, I need to get the top hit for > the target request ("dog") restricted to that value for the faceted field. > > Currently this is 11 total requests, of which the 10 requests following the > initial query can be made in parallel. But that's still a lot of requests. > > So my questions are: > > 1. Is there any magic query to handle this with Solr as-is? > > 2. if not, is the best solution to create my own request handler? > > 3. And in that case, any input/tips on developing this type of custom > request handler? > > Thanks, > > -- Ken > > > -------------------------------------------- > Ken Krugler > +1 530-210-6378 > http://bixolabs.com > e l a s t i c w e b m i n i n g > > > > >