You'll want to use faceting, try to use a query like this

http://localhost:8080/Solr/select/?q=artist%3Awar&version=2.2&start=0&rows=0&facet=true&facet.limit=-1&facet.field=artist

replace localhost:8080 with your own :)

On Thu, Aug 20, 2009 at 2:40 PM, Daniel Löfquist <
daniel.lofqu...@it.cdon.com> wrote:

> 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
>

Reply via email to