lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Paul Elschot <>
Subject Precedence parser: NOT/AND, disableCoord
Date Sun, 13 Mar 2005 09:35:55 GMT
Dear readers,

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.

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 -.
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 also noticed a BooleanQuery(disableCoord) constructor.
This would be straightforward to implement in the new BooleanScorer2
by dropping the Coordinator there.

Paul Elschot

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message