lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jim Swainston <jimswains...@googlemail.com>
Subject Re: Grouping Clauses to Preserve Order of Boolean Precedence
Date Fri, 05 Aug 2011 08:45:10 GMT
Brilliant, that looks perfect. We're currently using an older version of
Lucene in which this was an experimental class. Looks like we should
upgrade.

Thanks

Jim

On 5 August 2011 02:10, Trejkaz <trejkaz@trypticon.org> wrote:

> On Fri, Aug 5, 2011 at 1:57 AM, Jim Swainston
> <jimswainston@googlemail.com> 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?
>
>
> http://lucene.apache.org/java/3_3_0/api/all/org/apache/lucene/queryParser/precedence/PrecedenceQueryParser.html
>
> 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.)
>
> TX
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
> For additional commands, e-mail: java-user-help@lucene.apache.org
>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message