Multi-select on more than one facet field

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Multi-select on more than one facet field

Nasseam Elkarra-3
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
Reply | Threaded
Open this post in threaded view
|

Re: Multi-select on more than one facet field

Yonik Seeley-2-2
On Tue, Mar 24, 2009 at 2:29 PM, Nasseam Elkarra <[hidden email]> 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