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 Jonathan Haddad <jo...@gmail.com> on 2009/03/23 22:00:37 UTC

filter query usage - equivalent of SQL IN?

Using a filter query, is it possible to specify a list of values that
a field must satisfy one of?

The use case is searching within multiple categories in a taxonomy.

Thanks in advance.
-- 
Jonathan Haddad
http://www.rustyrazorblade.com

Re: filter query usage - equivalent of SQL IN?

Posted by Jonathan Haddad <jo...@gmail.com>.
Worked like a charm.  Thanks.

Jon

On Mon, Mar 23, 2009 at 2:09 PM, Yonik Seeley
<yo...@lucidimagination.com> wrote:
> On Mon, Mar 23, 2009 at 5:00 PM, Jonathan Haddad
> <jo...@gmail.com> wrote:
>> Using a filter query, is it possible to specify a list of values that
>> a field must satisfy one of?
>
> It's not currently possible to specify them in separate filters (fq
> params)... one must combine them into a single filter query.
>
> fq=myfield:(A B C D E F)
>
> This assumes that the default lucene query operator is "OR"... if
> that's not the case then use
>
> fq=myfield:(A OR B OR C OR D OR E OR F)
>
>
> -Yonik
> http://www.lucidimagination.com
>



-- 
Jonathan Haddad
http://www.rustyrazorblade.com

Re: filter query usage - equivalent of SQL IN?

Posted by Yonik Seeley <yo...@lucidimagination.com>.
On Mon, Mar 23, 2009 at 5:00 PM, Jonathan Haddad
<jo...@gmail.com> wrote:
> Using a filter query, is it possible to specify a list of values that
> a field must satisfy one of?

It's not currently possible to specify them in separate filters (fq
params)... one must combine them into a single filter query.

fq=myfield:(A B C D E F)

This assumes that the default lucene query operator is "OR"... if
that's not the case then use

fq=myfield:(A OR B OR C OR D OR E OR F)


-Yonik
http://www.lucidimagination.com