--- On Wed, 9/12/12, Rajarshi Guha <rajarshi.g...@gmail.com> wrote:

> From: Rajarshi Guha <rajarshi.g...@gmail.com>
> Subject: multiple filter queries and boolean operators in SolrJ
> To: solr-user@lucene.apache.org
> Date: Wednesday, September 12, 2012, 12:58 AM
> Hi, I am accessing our Solr
> installation via SolrJ. Currently, we are
> supporting filter queries via the addFilterQuery() method
> of
> SolrQuery. However as far as I can see, the resultant
> documents that
> come out of the query are the intersection of all the
> filters.
> 
> Ideally, what I'd like to happen is that if we have two FQ's
> on the
> same field, the result should be the OR, whereas if we have
> two FQ's
> on different fields it should be AND.
> 
> The thread at 
> http://lucene.472066.n3.nabble.com/complex-boolean-filtering-in-fq-queries-td2038365.html
> seems to suggest that I could do this by constructing a URL
> manually.
> 
> But can this be done via SolrJ?

Does this work for you?

addFilterQuery("field1:(term1 OR term2)");
addFilterQuery("fiel2:term5");

Reply via email to