opensubscriber
   Find in this group all groups
 
Unknown more information…

j : java-user@lucene.apache.org 8 March 2005 • 4:32AM -0500

Re: QueryParser refactoring
by Morus Walter

REPLY TO AUTHOR
 
REPLY TO GROUP




Hi Erik,

> I've been making local changes to QueryParser to fix the operator
> precedence issues (i.e. currently A AND B OR C AND D parses to +A +B +C
> +D).
>
I had a quick look at the new QP. I didn't look at the code yet, but I
redid my patch at the weekend for the current code, and I found it quite
ugly ;-) I didn't finish it completely, so I didn't upload it to
bugzilla yet.

Your changes look great in general, though I find some issues:

1) 'stop OR stop AND stop' where stop is a stopword gives a parse error:
Encountered "<EOF>" at line 1, column 0.
Was expecting one of:
    <NOT> ...
...

2) Single term queries using +/- flags are parse to a query without flag
+a -> a
-a -> a
While this doesn't make a difference for +a it's a bit strange for -a,
OTOH -a isn't a usable query anyway.

3) a OR NOT b parses to 'a -b' which is the same as 'a AND NOT b'
   IMHO `a OR NOT b' should be `a OR (NOT b)' though lucene cannot search
   that. Maybe it should raise an error...
   a OR NOT b AND c (parsed to a -(+b +c)) should IMHO be parsed to `a (-b +c)'

Thanks for your effort,
       Morus

---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@luce...
For additional commands, e-mail: java-user-help@luce...

Bookmark with:

Delicious   Digg   reddit   Facebook   StumbleUpon

Related Messages

opensubscriber is not affiliated with the authors of this message nor responsible for its content.