Otis Gospodnetic writes: > Redirecting to lucene-user.... > > --- Jim Hargrave <[EMAIL PROTECTED]> wrote: > > Can anyone tell me why these two queries would produce different > > results: > > > > +A -B > > > > A -(-B) > > A and +A are not the same thing when you have multiple terms in a > query. > Hmm. As far as I understood boolean queries so far a -b and +a -b should be the same (while a b -c and +a +b -c are different of course).
a -(-b) on the other side contains a boolean query only searching for -b. Lucene can not handle this type of query. I'm not sure what happens in this case. But AFAIK you should never use a boolean query containing only prohibited terms in a query. If I test this, I don't get any results for a -(-b) and the same result for 'a' and 'a +(-b)'. The query parser patch I added yesterday to bugzilla, drops such queries. > > Also, we are having a hard time understanding why the Query parser > > takes this > > query: "A AND NOT B" and returns this "+A +(-B)". Shouldn't this be > > "+A -B"? > a AND NOT b IS parsed to +a -b by lucenes standard query parser. Don't know where you found +a +(-b). +a +(-b) would be wrong in the above sense. Morus --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
