Hi devs,

There is a discrepancy in parsing behavior between PrecedenceQueryParser and QueryParser if the query is both single term and negative-only, e.g. "-exchange:nasdaq".

In this case with QueryParser the returned Query object is instanceof BooleanQuery whereas with PrecedenceQueryParser it's of TermQuery instance. This is inconvenient since with the parsed query which is an instance of BooleanQuery class it's easy to check if the user-supplied query is negative only. This is not possible with TermQuery. This also means that the PrecedenceQueryParser parses "-exchange:nasdaq" to "+exchange:nasdaq". What's interesting, there is no such problem with negative-only queries consisting of at least two terms.

Is the above behavior a "feature" of the contrib parser or a bug?


Thanks,
Wojtek Burzynski

---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscr...@lucene.apache.org
For additional commands, e-mail: java-user-h...@lucene.apache.org

Reply via email to