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 Alok Bhandari <al...@gmail.com> on 2012/07/05 12:51:56 UTC

what is the sequence of execution of solr query , is it right to left?

Hello,

if I search solr with the criteria A AND B OR C , then what is the order of
execution of boolean operators?

I guess it is 

1)Get result of B OR C 
2) Get Result of A AND (result of step 1) 

Is it correct?. I am using solr 3.6.

--
View this message in context: http://lucene.472066.n3.nabble.com/what-is-the-sequence-of-execution-of-solr-query-is-it-right-to-left-tp3993182.html
Sent from the Solr - User mailing list archive at Nabble.com.

Re: what is the sequence of execution of solr query , is it right to left?

Posted by Alok Bhandari <al...@gmail.com>.
Thanks for the input. It is very helpful .

--
View this message in context: http://lucene.472066.n3.nabble.com/what-is-the-sequence-of-execution-of-solr-query-is-it-right-to-left-tp3993182p3993491.html
Sent from the Solr - User mailing list archive at Nabble.com.

Re: what is the sequence of execution of solr query , is it right to left?

Posted by Erick Erickson <er...@gmail.com>.
This question can't be answered correctly as asked. The query parser does not
implement boolean logic directly, so any answer is pretty much wrong. Here's
an excellent writeup of what the query parser actually does:

http://www.lucidimagination.com/blog/2011/12/28/why-not-and-or-and-not/

As pointed out in the blog if you were going to try to get
boolean-like behavior,
you must be careful to parenthesize properly....

Best
Erick

On Thu, Jul 5, 2012 at 6:51 AM, Alok Bhandari
<al...@gmail.com> wrote:
> Hello,
>
> if I search solr with the criteria A AND B OR C , then what is the order of
> execution of boolean operators?
>
> I guess it is
>
> 1)Get result of B OR C
> 2) Get Result of A AND (result of step 1)
>
> Is it correct?. I am using solr 3.6.
>
> --
> View this message in context: http://lucene.472066.n3.nabble.com/what-is-the-sequence-of-execution-of-solr-query-is-it-right-to-left-tp3993182.html
> Sent from the Solr - User mailing list archive at Nabble.com.