lucene-solr-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From entdeveloper <cameron.develo...@gmail.com>
Subject Grouping / Collapse Query
Date Wed, 13 Jul 2011 01:36:06 GMT
I'm messing around with the field collapsing in 4.x
http://wiki.apache.org/solr/FieldCollapsing . Is it currently possible to
group by a field with a certain value only and leave all the others
ungrouped using the group.query param? This currently doesn't seem to work
the way I want it to.

For example, I have documents all with a "type" field. Possible values are:
picture, video, game, other. I want to only group the pictures, and leave
all other documents ungrouped.

If I query something like:
q=dogs&group=true&group.query=type:picture

I ONLY get pictures back. Seems like this behaves more like an 'fq'

What I want is a result set that looks like this:

1. doc 1, type=video
2. doc 2, type=game
3. doc 3, type=picture, + 3 other pictures
4. doc 4, type=video
5. doc 5, type=video
...

I've also tried:
q=dogs&group=true&group.query=type:picture&group.query=-type:video
-type:game

But this doesn't work because the order of the groups don't put together the
correct order of results that would be displayed.

--
View this message in context: http://lucene.472066.n3.nabble.com/Grouping-Collapse-Query-tp3164433p3164433.html
Sent from the Solr - User mailing list archive at Nabble.com.

Mime
View raw message