Thanks Otis,
 
(We are developing our own customized query parser - so I thought the dev group
was more appropriate.)
 
 Sorry. I forgot a + on the second query. Should be:
 
+A -B

+A -(-B)
 
My friend explained this as -B is nothing and -(nothing) is everything. When
you AND A with everything you get a different result as "A AND NOT B". IS this
right?
 
But I think you have already answered my main question. We already have a
customized version of QueryParser so we will probably need to fix these problems
in order to generate the right query. You say these things have been brought up
before, but not fixed. Is the solution considered difficult? I'll take a look
myself - if I make progress I'll repost with the code.
 
Jim
 
--- 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.

> 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"?

Maybe it should.  QueryParser is not the smartest piece of code,
unfortunately, and this issue has been discussed several times before. 
It looks like QP is just translating things 'nicely' left to right and
not looking for 'AND NOT' and turning that into '-'.

Otis

The
> first gives incorrect results, the later works as expected.
>  
>  
> Jim 
>  
>  
> 

Reply via email to