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 the Text input is: > > >

Re: Grouping Clauses to Preserve Order of Boolean Precedence

2011-08-04 Thread Trejkaz
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 lookin

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 Chris Hostetter
: 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 i didn't say the QueryParser would do that with *that* input You asked... : > : Thanks Ian. How would you achieve the logic of the below q

Re: Grouping Clauses to Preserve Order of Boolean Precedence

2011-08-04 Thread Jim Swainston
would like the query parser to be doing is recognising the order of Boolean precedence so that it automatically gives me the nested query you describe e.g. SHOULD (+Marketing +Smith) SHOULD Davies. If Lucene can't do this does anyone know of any algorithms for generating these nested queries so

Re: Grouping Clauses to Preserve Order of Boolean Precedence

2011-08-03 Thread Chris Hostetter
: Thanks Ian. How would you achieve the logic of the below query using : BooleanQuery and BooleanClause.occur? How would you achieve the grouping : effect? : : (Marketing AND Smith) OR Davies The same way the query parser does: that's a BooleanQuery (A) with two "SHOULD" clauses, the first of w

Re: Grouping Clauses to Preserve Order of Boolean Precedence

2011-08-03 Thread Jim Swainston
> correct > > place. However, this would become more difficult as the number of clauses > > increases so I'm not sure how scalable this method would be. > > > > How would I work out where to place the brackets if the query was > something > > like: > &

Re: Grouping Clauses to Preserve Order of Boolean Precedence

2011-08-03 Thread Ian Lea
oup 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 not returned. I want to be > able

Grouping Clauses to Preserve Order of Boolean Precedence

2011-08-03 Thread Jim Swainston
d are not returned. I want to be able to apply the order of Boolean precedence so that this query is treated as: (Marketing AND Smith) OR Davies. The QueryParser will correctly parse the above query as (+Marketing +Smith) Davies meaning that results where only Davies is found will be returned

Re: Boolean Precedence

2006-02-22 Thread Eric Jain
Erik Hatcher wrote: I worked on it to a point, but I don't recall what open issues there were when I left it though they were fiddly. The test case may point you in the right direction:

Re: Boolean Precedence

2006-02-21 Thread Erik Hatcher
On Feb 21, 2006, at 5:39 PM, Eric Jain wrote: Daniel Noll wrote: http://tinyurl.com/hzsna Thanks! There is some mention of "open issues" with this parser. Anyone know what these are, and if anyone is still working on this? I worked on it to a point, but I don't recall what open issues th

Re: Boolean Precedence

2006-02-21 Thread Eric Jain
Daniel Noll wrote: http://tinyurl.com/hzsna Thanks! There is some mention of "open issues" with this parser. Anyone know what these are, and if anyone is still working on this? - To unsubscribe, e-mail: [EMAIL PROTECTED] For

Re: Boolean Precedence

2006-02-21 Thread Daniel Noll
Eric Jain wrote: Searched the mailing list, found something about a "PrecedenceQueryParser", but this seems to have disappeared? It's moved: http://tinyurl.com/hzsna Daniel -- Daniel Noll Nuix Australia Pty Ltd Suite 79, 89 Jones St, Ultimo NSW 2007, Australia Phone: (02) 9280 0699 Fax:

Boolean Precedence

2006-02-21 Thread Eric Jain
I was wondering: Is there any good reason why x AND y OR z is interpreted as +(+x y z) rather than +(+(+x +y) z) ? If yes, any suggestions how this could be accomplished most easily? Searched the mailing list, found something about a "PrecedenceQueryParser", but this seems to have