Re: Grouping Clauses to Preserve Order of Boolean Precedence

2011-08-05 Thread Jim Swainston
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 wrote: > On Fri, Aug 5, 2011 at 1:57 AM, Jim Swainston > wrote: > > So if

Re: Grouping Clauses to Preserve Order of Boolean Precedence

2011-08-04 Thread Jim Swainston
My Apologies Hoss, perhaps I should have been clearer. I'm trying to programatically build a BooleanQuery from text input. I want the BooleanQuery that is built to have the correct structure based on the precedence rules of Boolean Logic. So if the Text input is: Marketing AND Smith OR Davies I

Re: Grouping Clauses to Preserve Order of Boolean Precedence

2011-08-04 Thread Jim Swainston
But the query parser doesn't seem to do that for me with the input Marketing AND Smith OR Davies. The query parser gives me 3 clauses. 1 must clause for the term Marketing, 1 must clause for the term smith and 1 should clause for the term Davies. e.g. +Marketing +Smith SHOULD Davies. What I would l

Re: Grouping Clauses to Preserve Order of Boolean Precedence

2011-08-03 Thread Jim Swainston
r > logic you need with BooleanClause.Occur. > > > There are alternative parsers in contrib. They might have more > support for grouping clauses. > > > > -- > Ian. > > > On Wed, Aug 3, 2011 at 2:26 PM, Jim Swainston > wrote: > > Hi, > > > > I'

Grouping Clauses to Preserve Order of Boolean Precedence

2011-08-03 Thread Jim Swainston
Hi, I'm having trouble thinking of a way to effectively group clauses to form sub queries. For example, I need to handle the following query: Marketing AND Smith OR Davies. Lucene is currently parsing this as +Marketing +Smith Davies meaning that results where only the term Davies is found are