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 Frank A <fs...@gmail.com> on 2010/08/12 03:42:18 UTC

How to "OR" facet queries

Hi,  I have 3 facet fields (A,B,C) the values of each facet field will
be shown as check boxes to users:

Field A
[x]  Val1a
[x]  Val2a
[]  Val3a

Field B
[x] Val1b
[] Val2b
[] Val3b

Within a field if the user selects two items I want the queries to be
an "OR" query.  Currently I'm generating something like:

&fq=FieldA%3AVal1a&fq=FieldA%3AVal2a&fq=FieldB%3AVal1b

This is not working as the first two filter queries are 'and'ing.
What is the proper syntax to accomplish what I'm trying to do?

Thanks.

Re: How to "OR" facet queries

Posted by Geek Gamer <ge...@gmail.com>.
On Thu, Aug 12, 2010 at 7:12 AM, Frank A <fs...@gmail.com> wrote:

> Hi,  I have 3 facet fields (A,B,C) the values of each facet field will
> be shown as check boxes to users:
>
> Field A
> [x]  Val1a
> [x]  Val2a
> []  Val3a
>
> Field B
> [x] Val1b
> [] Val2b
> [] Val3b
>
> Within a field if the user selects two items I want the queries to be
> an "OR" query.  Currently I'm generating something like:
>
> &fq=FieldA%3AVal1a&fq=FieldA%3AVal2a&fq=FieldB%3AVal1b
>
&fq=FieldA%3AVal1a%20OR%20FieldA%3AVal2a&fq=FieldB%3AVal1b

>
> This is not working as the first two filter queries are 'and'ing.
> What is the proper syntax to accomplish what I'm trying to do?
>
> Thanks.
>