Return-Path: Delivered-To: apmail-lucene-java-user-archive@www.apache.org Received: (qmail 54016 invoked from network); 1 Apr 2005 16:14:07 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 1 Apr 2005 16:14:07 -0000 Received: (qmail 85914 invoked by uid 500); 1 Apr 2005 16:13:46 -0000 Delivered-To: apmail-lucene-java-user-archive@lucene.apache.org Received: (qmail 85858 invoked by uid 500); 1 Apr 2005 16:13:46 -0000 Mailing-List: contact java-user-help@lucene.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: java-user@lucene.apache.org Delivered-To: mailing list java-user@lucene.apache.org Received: (qmail 85801 invoked by uid 99); 1 Apr 2005 16:13:45 -0000 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received-SPF: neutral (hermes.apache.org: local policy) Received: from mail.crcpress.com (HELO flexbe01.crcpress.com) (65.244.170.27) by apache.org (qpsmtpd/0.28) with ESMTP; Fri, 01 Apr 2005 08:13:44 -0800 X-MimeOLE: Produced By Microsoft Exchange V6.5.6944.0 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Subject: RE: FilteredQuery and Boolean AND Date: Fri, 1 Apr 2005 11:13:41 -0500 Message-ID: <78A2AFE317F5AD48B823BE740D4A815224070D@flexbe01.crcpress.com> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: FilteredQuery and Boolean AND Thread-Index: AcUxUBgGSqKrSKbOQASE4TXxhK/3pgFhLivw From: "Kipping, Peter" To: X-Virus-Checked: Checked X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Any ideas on this? I have purchased your book, Lucene in Action, which is quite good. To make things easier, consider the example on p212. In item 4, when you combine the queries, what happens you combine them in and AND fashion? The book only has OR, which works. Although it may work since the book only has one filtered query, but what if you made them both filtered queries and ANDed them? Thanks, Peter -----Original Message----- From: Kipping, Peter [mailto:Peter.Kipping@taylorandfrancis.com]=20 Sent: Friday, March 25, 2005 10:34 AM To: java-user@lucene.apache.org Subject: FilteredQuery and Boolean AND I have the following query structure: BooleanQuery q2 =3D new BooleanQuery(); TermQuery tq =3D new TermQuery(new Term("all_entries", "y")); FilteredQuery fq =3D new FilteredQuery(tq, ft); FilteredQuery fq2 =3D 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: java-user-unsubscribe@lucene.apache.org For additional commands, e-mail: java-user-help@lucene.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org For additional commands, e-mail: java-user-help@lucene.apache.org