: 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 query using : > : BooleanQuery and BooleanClause.occur? How would you achieve the grouping : > : effect? : > : : > : (Marketing AND Smith) OR Davies ...and i said... : > The same way the query parser does: that's a BooleanQuery (A) with two : > "SHOULD" clauses, the first of which is a nested BooleanQuery (B) (with : > two "MUST" clauses (X child of B) Marketing, and (Y child of B) Smith), : > and the 2nd of which (C, child of A) is a query for Davies. ...which is exactly what the QueryParser would do given *that* input (with parens) If you want to programaticlly build up a query with the structure you are describing, nested BooleanQuery objects is how you do it. -Hoss --------------------------------------------------------------------- To unsubscribe, e-mail: java-user-unsubscr...@lucene.apache.org For additional commands, e-mail: java-user-h...@lucene.apache.org