Hi Daniel, I think you should take a look at https://issues.apache.org/jira/browse/SOLR-236. The functionality you are looking for is called field collapsing in Solr and does grouping by field. Currently this is not supported out of the box in Solr. The jira issue contains a patch you that you can apply on the Solr trunk. Take a look at http://wiki.apache.org/solr/FieldCollapsing for more information on FieldCollapsing.
Cheers, Martijn 2009/8/20 Daniel Löfquist <daniel.lofqu...@it.cdon.com>: > Hello, > > I'm trying to accomplish something akin to "GROUP BY" in SQL but in Solr. > I have an index full of songs (one song per document in Solr) by various > artists and I > would like to construct a search that gives me all of the artists back, one > row per > artist. The current search returns one row per artist and song. > > So I get this right now if I search after "war" in the artist-field: > > 30 Years War - Ideal Means > 30 Years War - Dirty Castle > 30 Years War - Misinformed > All Out War - Soaked In Torment > All Out War - Claim Your Innocence > Audio War - Negativity > Audio War - One Drug > Audio War - Super Freak > > But this is what I'd really like: > > 30 Years War - whatever song > All Out War - whatever song > Audio War - whatever song > > I tried using facets but couldn't get it to work properly. Anybody have a > clue how to do > something like this? > > //Daniel