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 Nasseam Elkarra <na...@bodukai.com> on 2009/03/24 19:29:06 UTC

Multi-select on more than one facet field

Looking at the example here:
http://wiki.apache.org/solr/SimpleFacetParameters#head-4ba81c89b265c3b5992e3292718a0d100f7251ef

This being the query for selecting PDF:
q=mainquery&fq=status:public&fq={! 
tag=dt}doctype:pdf&facet=on&facet.field={!ex=dt}doctype

How would you do the query for selecting PDF OR Excel AND, assuming  
there is another facet field named author, where author is Mike?

Thank you,
Nasseam

Re: Multi-select on more than one facet field

Posted by Yonik Seeley <yo...@lucidimagination.com>.
On Tue, Mar 24, 2009 at 2:29 PM, Nasseam Elkarra <na...@bodukai.com> wrote:
> Looking at the example here:
> http://wiki.apache.org/solr/SimpleFacetParameters#head-4ba81c89b265c3b5992e3292718a0d100f7251ef
>
> This being the query for selecting PDF:
> q=mainquery&fq=status:public&fq={!tag=dt}doctype:pdf&facet=on&facet.field={!ex=dt}doctype
>
> How would you do the query for selecting PDF OR Excel AND, assuming there is
> another facet field named author, where author is Mike?

If author is not a multi-select facet (i.e. you already selected
author:Mike and hence wish to no longer get other counts for the
author field) then:

q=mainquery
&fq=status:public
&fq={!tag=dt}doctype:(PDF OR Excel)
&fq=author:Mike
&facet=on&facet.field={!ex=dt}doctype

If author *is* multi-select, then you wish to get facet counts for the
author field, ignoring the author:Mike restriction for the author
facet only:

q=mainquery
&fq=status:public
&fq={!tag=dt}doctype:(PDF OR Excel)
&fq={!tag=auth}author:Mike
&facet=on&facet.field={!ex=dt}doctype
&facet.field={!ex=auth}author


-Yonik
http://www.lucidimagination.com