DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG� RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT <http://issues.apache.org/bugzilla/show_bug.cgi?id=34279>. ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND� INSERTED IN THE BUG DATABASE.
http://issues.apache.org/bugzilla/show_bug.cgi?id=34279 Summary: Combining FilteredQueries in a BooleanQuery doesn't work Product: Lucene Version: unspecified Platform: Other OS/Version: other Status: NEW Severity: normal Priority: P2 Component: Search AssignedTo: [email protected] ReportedBy: [EMAIL PROTECTED] from [EMAIL PROTECTED] ... : > From: Kipping, Peter : > Sent: Friday, March 25, 2005 10:34 AM : > To: java-user : > Subject: FilteredQuery and Boolean AND : > : > 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? Date: Fri, 1 Apr 2005 16:52:55 -0800 (PST) From: Chris Hostetter To: java-user Subject: Re: FilteredQuery and Boolean AND Peter's problem intrigued me, so I wrote my own test case using two simple Filters that filter out all but the first (or last) doc. I seem to be getting the same results he is, which is certianly. see attached test case. while this definitely seems like a bug, it also seems like a fairly inefficinent way of approaching hte problem in general, instead of: BooleanQuery containing: a) FilteredQuery wrapping: Query for "all" -- filtered by -- RangeFilter #1 b) FilteredQuery wrapping: Query for "all" -- filtered by -- RangeFilter #2 ...it seems like it would make more sense to use... FilterQuery wrapping: Query for all -- filtered by -- ChainedFilter containing: a) RangeFilter #1 b) RangeFilter #2 ------------------------------- I'll attach the testcase momentarily -- Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the assignee for the bug, or are watching the assignee. --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
