Return-Path: Delivered-To: apmail-lucene-java-user-archive@www.apache.org Received: (qmail 59205 invoked from network); 10 Sep 2010 17:06:59 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 10 Sep 2010 17:06:59 -0000 Received: (qmail 38260 invoked by uid 500); 10 Sep 2010 17:06:57 -0000 Delivered-To: apmail-lucene-java-user-archive@lucene.apache.org Received: (qmail 38190 invoked by uid 500); 10 Sep 2010 17:06:56 -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 38182 invoked by uid 99); 10 Sep 2010 17:06:56 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 10 Sep 2010 17:06:56 +0000 X-ASF-Spam-Status: No, hits=-0.7 required=10.0 tests=RCVD_IN_DNSWL_LOW,SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: local policy) Received: from [69.32.146.52] (HELO thomsonlearning.com) (69.32.146.52) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 10 Sep 2010 17:06:51 +0000 Received: from ([10.160.3.176]) by ohciniron01.thomsonlearning.com with ESMTP with TLS id 5502565.50078598; Fri, 10 Sep 2010 13:06:26 -0400 Received: from ohcinpub02.corp.local (10.160.3.252) by ohcinht04.corp.local (10.160.3.176) with Microsoft SMTP Server (TLS) id 8.2.254.0; Fri, 10 Sep 2010 13:06:26 -0400 Received: from OHCINMBX01.corp.local ([10.160.3.161]) by ohcinpub02.corp.local ([10.160.3.252]) with mapi; Fri, 10 Sep 2010 13:06:26 -0400 From: "Nader, John P" To: "java-user@lucene.apache.org" , "yonik@lucidimagination.com" Date: Fri, 10 Sep 2010 13:06:25 -0400 Subject: RE: Filters do not work with MultiSearcher? Thread-Topic: Filters do not work with MultiSearcher? Thread-Index: ActRBedD3Wru/DPETCa9vA3TEaGuGwABB8NA Message-ID: <70EA5691BD59734784FF872CD1B9747A15D73E1771@OHCINMBX01.corp.local> References: <70EA5691BD59734784FF872CD1B9747A15D73E1728@OHCINMBX01.corp.local> In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: acceptlanguage: en-US x-tm-as-product-ver: SMEX-8.0.0.1181-6.500.1024-17628.003 x-tm-as-result: No--51.696700-8.000000-31 x-tm-as-user-approved-sender: No x-tm-as-user-blocked-sender: No Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Thanks. Now I understand. We changed my implementation to hold multiple bit sets, one per index reade= r. Then we return the correct bit set based upon which reader is being pas= sed in. =20 The results are exactly what we need. This is our first use of the MultiSe= archer (as if that wasn't obvious) and our assumption was that a MultiReade= r was being passed in. Thank you for your quick response and useful insights. -John -----Original Message----- From: yseeley@gmail.com [mailto:yseeley@gmail.com] On Behalf Of Yonik Seele= y Sent: Friday, September 10, 2010 12:32 PM To: java-user@lucene.apache.org Subject: Re: Filters do not work with MultiSearcher? This is "working as designed". Note this method: public DocIdSet getDocIdSet(IndexReader indexReader) throws IOException { return openBitSet; } You must pay attention to the IndexReader passed - and the DocIdSet returned must always be based on that reader (and the first document of every reader is always 0). So returning the same DocIdSet each time is not valid and will result in errors. -Yonik http://lucenerevolution.org Lucene/Solr Conference, Boston Oct 7-8 On Fri, Sep 10, 2010 at 12:23 PM, Nader, John P wr= ote: > We are attempting to perform a filtered search on two indices joined by a= MultiSearcher. =A0Unfortunately, it appears there is an issue in the lucen= e code that is causing the filter to be simply reused at the starting ordin= al for each individual index instead of being augmented by the starting doc= ument identifier. =A0We are hoping there is an alternate API that will allo= w us to perform a filtered search on multiple indices. > > For example, we have two indices with three documents each, and a filter = containing only doc ID 1. =A0When we perform a filtered search on a MultiSe= archer that joins these two indices, we get two documents back (1, 4), wher= e we were expecting only the one. =A0This is because the MultiSearcher, ins= tead of starting at doc ID 3 for the second index, is interpreting the filt= er individually for each index. > > We are using Lucene 3.0.2. =A0The API we see this behavior with is MultiS= earcher.search(Query, Filter, nDocs) with a MatchAllDocsQuery and the filte= r code pasted below: > > public class OpenBitSetFilter extends Filter { > > =A0 =A0private OpenBitSet openBitSet; > > > =A0 =A0public OpenBitSetFilter(OpenBitSet openBitSet) { > =A0 =A0 =A0 =A0this.openBitSet =3D openBitSet; > =A0 =A0} > > =A0 =A0public DocIdSet getDocIdSet(IndexReader indexReader) throws IOExce= ption { > =A0 =A0 =A0 =A0return openBitSet; > =A0 =A0} > > } > > > --------------------------------------------------------------------- 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