Hi,
I'm having problems understanding query parsers handling of AND and OR
if there's more than one operator.
E.g.
a OR b AND c
gives the same number of hits as
b AND c
(only scores are different)
and
a AND b OR c AND d
seems to be equivalent to
a AND b AND C AND d
which doesn't seem logical to me.
I'd expect to have AND higher precedence than OR (as a logical AND / OR in
C or Java) so that a OR b AND c would be equivalent to a OR (b AND c)
and a AND b OR c AND d equivalent to (a AND b) OR (c AND d)
When I look at the query parsers sources, I find, that -- unless paranthesis
are used -- all these terms are added to one boolean query, and the
AND operator makes the term left and right of it required (unless there
are NOT operators making them prohibited).
So
a OR b AND c gives one boolean query where b and c are required, whereas
a is not.
a AND b OR c AND d produces a boolean query where a, b, c and d are required,
which is indeed the same as a AND b AND c AND d.
Should this be considered a bug?
greetings
Morus
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]