You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@lucene.apache.org by Omar Didi <od...@Cyveillance.com> on 2005/02/25 22:19:45 UTC

help with boolean expression

I have a problem understanding how would lucene iterpret this boolean expression : A AND B OR C .
it neither return the same count as when I enter (A AND B) OR C nor A AND (B OR C). 
if anyone knows how it is interpreted i would be thankful.
thanks

Re: help with boolean expression

Posted by Erik Hatcher <er...@ehatchersolutions.com>.
On Feb 25, 2005, at 4:19 PM, Omar Didi wrote:
> I have a problem understanding how would lucene iterpret this boolean 
> expression : A AND B OR C .
> it neither return the same count as when I enter (A AND B) OR C nor A 
> AND (B OR C).
> if anyone knows how it is interpreted i would be thankful.

Output the toString() of the returned Query instances to see how 
QueryParser interpreted things.

	Erik


---------------------------------------------------------------------
To unsubscribe, e-mail: lucene-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: lucene-user-help@jakarta.apache.org


Re: help with boolean expression

Posted by Morus Walter <mo...@tanto.de>.
Omar Didi writes:
> I have a problem understanding how would lucene iterpret this boolean expression : A AND B OR C .
> it neither return the same count as when I enter (A AND B) OR C nor A AND (B OR C). 
> if anyone knows how it is interpreted i would be thankful.
> thanks

A AND B OR C creates a query that requires A and B. C influcenes the 
score, but is neither sufficient nor required for a match.

IMO query parser is broken for queries mixing AND and OR without explicit
braces.
My favorite sample is `a AND b OR c AND d' which equals `a AND b AND c AND d'
in query parser.

I suggested a patch some time ago, but it's still pending in bugzilla.
http://issues.apache.org/bugzilla/show_bug.cgi?id=25820

Don't know if it's still usable with current sources.

Morus

---------------------------------------------------------------------
To unsubscribe, e-mail: lucene-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: lucene-user-help@jakarta.apache.org