lucene-general mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Chris Hostetter <hossman_luc...@fucit.org>
Subject Re: operator precedence and confusing result
Date Sun, 08 Mar 2009 22:46:49 GMT

: A)   medicine AND (cat OR dog OR horse OR fish)     =  10,000 results
: B)   medicine AND cat OR dog OR horse OR fish        = 4,000 results
: C)  (medicine AND cat) OR dog OR horse OR fish     = 90,000 results
: (which tells me this isn't how B is interpretted)

it's important to rememebr that Lucene isn't a boolean matching system -- 
the undelrying semantics are MUST/MUST_NOT/SHOULD -- the AND/OR
keywords are just syntactic sugar that attempt to apply underlying 
semantics as binary opperators.

if you look at the toString output of queries you can see what the parser 
has done to try and apply your use of AND/OR to the underlying query 
structures.  here's an example of what the toString for those queries 
looks like (my analyzer does some stemming, but the structure of hte 
queries is going to be the same regardless of the analyzer)


A) +text:medicin +(text:cat text:dog text:hors text:fish)
B) +text:medicin +text:cat text:dog text:hors text:fish
C) (+text:medicin +text:cat) text:dog text:hors text:fish

...Does the discrepency in the number of results make sense now?


-Hoss


Mime
View raw message