lucene-general mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jenny Brown <>
Subject Re: operator precedence and confusing result
Date Mon, 16 Mar 2009 19:55:04 GMT
Ok, after Mike Klaas's explanation of how it's translated, and a few
minutes of really studying your examples, this makes sense to me now.
And the number of results makes sense.  Now my challenge is how to
explain this to my users - oi, what a difference, and subtleties.

Thanks for the help.  I do have one remaining question.  How do
proximity searches fit into this?
I often have users performing a search like:

"music arts"~10 OR "band festival" OR "rock concert"

and then reporting back to me that they'll see results containing just
the word band, or just the word concert, that don't match an entire
phrase.  Am I misunderstanding phrase search here?  Is the proximity
search changing the behavior of the whole query?

Jenny Brown

On Sun, Mar 8, 2009 at 5:46 PM, Chris Hostetter
<> wrote:
> : 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

View raw message