[prev in list] [next in list] [prev in thread] [next in thread] 

List:       lucene-user
Subject:    RE: help with boolean expression
From:       "Omar Didi" <odidi () Cyveillance ! com>
Date:       2005-03-01 14:12:01
Message-ID: 63434C14F9A6F74CB36B85033E4C30CA01082996 () hermes ! corp ! cyveillance ! com
[Download RAW message or body]

I found something kind fo weird about the way lucene interprets boolean expressions \
wihout parenthesis. when i run the query A AND B OR C, it returns only the documents \
that have A(in other words as if the query was just the term A).  when I run the \
query A OR B AND C, it returns only the documents that have B AND C(as if teh query \
was just B AND C ). I set the default operator in my application to be AND.  can \
anyone explain this behavior, thanks.

-----Original Message-----
From: Morus Walter [mailto:morus.walter@tanto.de]
Sent: Monday, February 28, 2005 2:40 AM
To: Lucene Users List
Subject: Re: help with boolean expression


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


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


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic