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 Andy <an...@yahoo.com> on 2010/10/09 23:20:02 UTC

"OR" facet queries?

I want to enable users to select multiple facet values for a specific facet fields. For example, if "color" is a facet field, I'd like to let users to select "red" OR "blue".

Please note, I've set
<solrQueryParser defaultOperator="AND" />
because I want "q=hello+world" means "hello" and "world" are AND'ed together.

1) What is the syntax of doing that? Can I implement that by putting "OR" within the fq clause?
E.g.
&facet=on&facet.field=color&facet.field=size
&fq=color:(red OR blue)
&fq=size:(M OR L)

2) Is there a performance penalty associated with using "OR" on the facet values like that? If so how much of a penalty?

Thanks





      

Re: "OR" facet queries?

Posted by Ahmet Arslan <io...@yahoo.com>.
> I want to enable users to select
> multiple facet values for a specific facet fields. For
> example, if "color" is a facet field, I'd like to let users
> to select "red" OR "blue".
> 
> Please note, I've set
> <solrQueryParser defaultOperator="AND" />
> because I want "q=hello+world" means "hello" and "world"
> are AND'ed together.
> 
> 1) What is the syntax of doing that? Can I implement that
> by putting "OR" within the fq clause?
> E.g.
> &facet=on&facet.field=color&facet.field=size
> &fq=color:(red OR blue)
> &fq=size:(M OR L)

Yes you can do that filter queries.  

You may find this interesting. http://wiki.apache.org/solr/SimpleFacetParameters#Multi-Select_Faceting_and_LocalParams