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 Jean-Sebastien Vachon <js...@videotron.ca> on 2010/11/25 21:22:56 UTC

Facet.query and collapsing

Hi All,

I'm in a situation where I need to perform a facet on a query with field collapsing.

Let's say the main query is something like this

title:apple&fq={!tag=sources}source_id:(33 OR 44)&facet=on&facet.field={!ex=sources}source_id&facet.query=source_id:(33 OR 44)&collapse=on&collapse.field=hash_id

I'd like my facet query to return the number of unique documents (based on the hash_id field) that are associated to either source 33 or 44

Right now, the query works but the count returned is larger than expected since there is no collapsing performed on the facet query's result set.

Is there any way of doing this? I'd like to be able to do this without performing a second request.

Thanks

NOTE: I'm using Solr 1.4.1 with patch 236 (https://issues.apache.org/jira/browse/SOLR-236)




Re: Facet.query and collapsing

Posted by Markus Jelsma <ma...@openindex.io>.
http://wiki.apache.org/solr/FieldCollapsing#Known_Limitations

> Hi All,
> 
> I'm in a situation where I need to perform a facet on a query with field
> collapsing.
> 
> Let's say the main query is something like this
> 
> title:apple&fq={!tag=sources}source_id:(33 OR
> 44)&facet=on&facet.field={!ex=sources}source_id&facet.query=source_id:(33
> OR 44)&collapse=on&collapse.field=hash_id
> 
> I'd like my facet query to return the number of unique documents (based on
> the hash_id field) that are associated to either source 33 or 44
> 
> Right now, the query works but the count returned is larger than expected
> since there is no collapsing performed on the facet query's result set.
> 
> Is there any way of doing this? I'd like to be able to do this without
> performing a second request.
> 
> Thanks
> 
> NOTE: I'm using Solr 1.4.1 with patch 236
> (https://issues.apache.org/jira/browse/SOLR-236)