You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-user@lucene.apache.org by vit <bu...@yahoo.com> on 2015/01/12 23:09:32 UTC

get one document per value in multivalued field

I use Solr4.21
my multivalued filed is like that:
q=(category_id:(484986 520623 484339 519258 516227 486757) ......

How to construct a query which will show one top document per category_id
value?



--
View this message in context: http://lucene.472066.n3.nabble.com/get-one-document-per-value-in-multivalued-field-tp4179056.html
Sent from the Solr - User mailing list archive at Nabble.com.

Re: get one document per value in multivalued field

Posted by Shawn Heisey <ap...@elyograg.org>.
On 1/12/2015 3:09 PM, vit wrote:
> I use Solr4.21
> my multivalued filed is like that:
> q=(category_id:(484986 520623 484339 519258 516227 486757) ......
>
> How to construct a query which will show one top document per category_id
> value?

This is a feature called grouping, or field collapsing.

https://wiki.apache.org/solr/FieldCollapsing
https://cwiki.apache.org/confluence/display/solr/Result+Grouping

Thanks,
Shawn


Re: get one document per value in multivalued field

Posted by vit <bu...@yahoo.com>.
The field must be single-valued for grouping. That is why I do not consider
this option. 



--
View this message in context: http://lucene.472066.n3.nabble.com/get-one-document-per-value-in-multivalued-field-tp4179056p4179065.html
Sent from the Solr - User mailing list archive at Nabble.com.