I have the following query structure:

BooleanQuery q2 = new BooleanQuery();
TermQuery tq = new TermQuery(new Term("all_entries", "y"));
FilteredQuery fq = new FilteredQuery(tq, ft);
FilteredQuery fq2 = new FilteredQuery(tq, ft2);
q2.add(fq, false, false);
q2.add(fq2, false, false);

The two filters are searches over numeric ranges.  I'm using filters so
I don't get the TooManyBooleanClauses Exception.  And my TermQuery tq is
just a field that has 'y' in every document so I can filter over the
entire index.  The last two lines I am creating a boolean OR, and
everything works fine.  I get back 30 documents which is correct.

However when I change the last two lines to create an AND:

q2.add(fq, true, false);
q2.add(fq2, true, false);

I still get back 30 documents, which is not correct.  It should be 0.
What's going on with FilteredQuery?

Thanks,
Peter


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to