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 Jamie Johnson <je...@gmail.com> on 2011/06/08 23:34:03 UTC

FilterQuery and Ors

I'm looking for a way to do a filter query and Ors.  I've done a bit of
googling and found an open jira but nothing indicating this is possible.
I'm looking to do something like the search at
http://www.lucidimagination.com/search/?q=test
where you can do multi selects for the facets.  I've read about it at
http://wiki.apache.org/solr/SimpleFacetParameters#Multi-Select_Faceting_and_LocalParamsso
I have the tag/exclusion working but if I select two items from a
facet
group (say age from 1 to 10 and age from 10 to 20) I get nothing because
nothing meets both of those criteria.  I can obviously write something
custom to build an OR out of this but that seems less elegant.  Any guidance
would be appreciated

Re: FilterQuery and Ors

Posted by Erick Erickson <er...@gmail.com>.
try fq=age:[1 TO 10] OR age:[10 TO 20]

I'm pretty sure

fq=age:([1 TO 10] OR [10 TO 20])

will work too.

But you're right, multiple fq clauses are intersections, so specifying more
than one fq clause on the SAME field results in what you're seeing.

Best
Erick

On Wed, Jun 8, 2011 at 5:34 PM, Jamie Johnson <je...@gmail.com> wrote:
> I'm looking for a way to do a filter query and Ors.  I've done a bit of
> googling and found an open jira but nothing indicating this is possible.
> I'm looking to do something like the search at
> http://www.lucidimagination.com/search/?q=test
> where you can do multi selects for the facets.  I've read about it at
> http://wiki.apache.org/solr/SimpleFacetParameters#Multi-Select_Faceting_and_LocalParamsso
> I have the tag/exclusion working but if I select two items from a
> facet
> group (say age from 1 to 10 and age from 10 to 20) I get nothing because
> nothing meets both of those criteria.  I can obviously write something
> custom to build an OR out of this but that seems less elegant.  Any guidance
> would be appreciated
>