lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Erik Hatcher <e...@ehatchersolutions.com>
Subject Re: Precedence parser: NOT/AND, disableCoord
Date Tue, 15 Mar 2005 00:55:33 GMT

On Mar 13, 2005, at 2:35 AM, Paul Elschot wrote:
> I had a short look through the new precedence parser
> and noticed a possible issue.
>
> Adding this in the TestPrecedenceParser testSimple() method:
>
>     assertQueryEquals("NOT a AND b", null, "-a +b");
>    // currently parses as -(+a +b)
>
> fails the test because it parses as NOT (a AND b).
>
> This might be improved by using the modifier (+, - , NOT) at the
> clause level instead of at the andExpression level.

Paul - I attempted to do this, but my efforts were not successful, and 
actually broke more tests than it corrected, so I reverted my local 
changes.

I'd welcome others to give it a try, though.  I'm still learning how to 
accomplish things with JavaCC.

> About a year ago I tried to come up with a good syntax for
> mixing AND/OR/NOT and +/- and brackets in a consistent
> way, and I gave up, dropping the + and -.

I've struggled (and still struggling) with this same thing myself.  
AND/OR are problematic because of the nature of boolean clauses, which 
individually have their own required/prohibited flags, not in 
_conjunction_ with another clause.

> However, from what I see now in the precedence parser,
> giving up might have been premature. It seems to be possible
> to make the mix after all.

I believe its possible, but I won't be spending time on it in the next 
few weeks at least - anyone interested in the next generation query 
parser is encouraged to pick up the torch.

	Erik


---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-dev-help@lucene.apache.org


Mime
View raw message