filter query usage - equivalent of SQL IN?

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

filter query usage - equivalent of SQL IN?

Jonathan Haddad-2
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
Reply | Threaded
Open this post in threaded view
|

Re: filter query usage - equivalent of SQL IN?

Yonik Seeley-2-2
On Mon, Mar 23, 2009 at 5:00 PM, Jonathan Haddad
<[hidden email]> 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
Reply | Threaded
Open this post in threaded view
|

Re: filter query usage - equivalent of SQL IN?

Jonathan Haddad-2
Worked like a charm.  Thanks.

Jon

On Mon, Mar 23, 2009 at 2:09 PM, Yonik Seeley
<[hidden email]> wrote:

> On Mon, Mar 23, 2009 at 5:00 PM, Jonathan Haddad
> <[hidden email]> 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