Recently I found that it makes difference whether your query looks like:
A AND NOT B
or it is
A AND (NOT B)
Some research using Luke showed that in the first case the query is
rewritten as:
+A -B
while the second is rewritten as
+A +(-B)
after the usual "wtf?" I've recalled that there was a dicussion on this
issue on the lucene uses list.
I found it and yes, it was explaining that QueryParser is rather
primitive and does not take the usual
operator precedence into account.
Then I read the explanation of types of queries in the "Lucene in
Action" and everything seemed clear for a moment,
except:
Why the two above mentioned queries return different results?
Is it because the first one means: "get all docs that contain A and do
not contain B"
and the second one means "get all docs that contain A and intersect them
with the docs returned from the query (-B)"
and (-B) as a pure negative query returns 0 results ?
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]