lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Trejkaz <>
Subject Re: Grouping Clauses to Preserve Order of Boolean Precedence
Date Fri, 05 Aug 2011 01:10:32 GMT
On Fri, Aug 5, 2011 at 1:57 AM, Jim Swainston
<> wrote:
> So if the Text input is:
> Marketing AND Smith OR Davies
> I want my program to work out that this should be grouped as the following
> (as AND has higher precedence than OR):
> (Marketing AND Smith) OR Davies.
> I'm effectively looking for an algorithm that will properly group any number
> of terms......

Have you tried using PrecedenceQueryParser instead of the standard one?

It probably does the right thing.

(Related but not part of the answer: I solved the issue here by making
it a parser-level feature, since I was making my own parser anyway.
When we get the AST from the parser, the precedence has already been
figured out.)


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

View raw message