: I want a query of the form:
:
: x AND ( a OR b OR c OR d)
what your code is currenlty doing is adding 5 term queries to a single
boolean query.
The structure you want is not a single boolean query, it's a boolean query
containing two mandatory clauses: the first being a term query, and the
sec
Michael Pickard wrote:
Can anyone help me with the formation of a BooleanQuery ?
I want a query of the form:
x AND ( a OR b OR c OR d)
You're going to need 2 BooleanQuery objects, one for the OR'd expression
in parentheses, and another for the AND and expression. Something like
this:
Can anyone help me with the formation of a BooleanQuery ?
I want a query of the form:
x AND ( a OR b OR c OR d)
The nearest I've managed to get is
query.add(new TermQuery(new Term(2, "x")),true,false);
Term term = null;
for (int i=1; i