Return-Path: Delivered-To: apmail-lucene-java-user-archive@www.apache.org Received: (qmail 63080 invoked from network); 11 Jun 2007 04:46:48 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 11 Jun 2007 04:46:48 -0000 Received: (qmail 58658 invoked by uid 500); 11 Jun 2007 04:46:44 -0000 Delivered-To: apmail-lucene-java-user-archive@lucene.apache.org Received: (qmail 58594 invoked by uid 500); 11 Jun 2007 04:46:44 -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 58583 invoked by uid 99); 11 Jun 2007 04:46:43 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 10 Jun 2007 21:46:43 -0700 X-ASF-Spam-Status: No, hits=2.3 required=10.0 tests=HTML_MESSAGE,MAILTO_TO_SPAM_ADDR,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (herse.apache.org: domain of luz290@gmail.com designates 66.249.82.224 as permitted sender) Received: from [66.249.82.224] (HELO wx-out-0506.google.com) (66.249.82.224) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 10 Jun 2007 21:46:39 -0700 Received: by wx-out-0506.google.com with SMTP id t8so1208716wxc for ; Sun, 10 Jun 2007 21:46:18 -0700 (PDT) DKIM-Signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:references; b=QWU34MErrVypRMHE1Vl16WQQIcIXRQevsYnN20gOM8mZ9OpfKQ+j9ZBoTMWaa20yGAsybFyjosqR458W1j4ePQRo5IbfZZ8rDBinmSApWIOMs6b+zPc5/12ro0XIhkS4BR5OzrhWak3qEaXbSnLoaN16qCQDJRak4aSqjlSgDTM= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:references; b=jlKAgFbrFrofSnaimCYw7DXZqX7lG+XAf7kSKnr5wrM0GIKGlbf8w7XcNAusjUOitDeLBgYnEwtYa9ccbNvcFn8drG59Sgt+BODIwn8EwBzKgA3OxVWzSKHNR6NwwIFNPomYs0XMZp1yXgEO4x7lIrrF/5bRw14laj0U5A9gFIw= Received: by 10.90.68.15 with SMTP id q15mr4812647aga.1181537178629; Sun, 10 Jun 2007 21:46:18 -0700 (PDT) Received: by 10.90.78.18 with HTTP; Sun, 10 Jun 2007 21:46:18 -0700 (PDT) Message-ID: Date: Sun, 10 Jun 2007 23:46:18 -0500 From: "lucene user" To: java-user@lucene.apache.org Subject: Re: next() not called in FilterIndexReader.FilterTermDocs In-Reply-To: <359a92830706101733w30535e44gb77c56292d5dc31d@mail.gmail.com> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_73280_16482305.1181537178607" References: <359a92830706101733w30535e44gb77c56292d5dc31d@mail.gmail.com> X-Virus-Checked: Checked by ClamAV on apache.org ------=_Part_73280_16482305.1181537178607 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline I already have this implemented with a filter. Its working alright, but sends my running time from .1 sec to .4 sec - thats no big deal now but we hope to eventually grow the archive to an insanely large size. Besides, I think the FilterIndexReader is a powerfull tool, and I'd like to get it working... I'd also like too know if my concept of how the index works at the low level is correct, and if this is my bug or a bug in lucene. On 6/10/07, Erick Erickson wrote: > > Wouldn't it be easier to just make a Filter? That's what they were > intended for. > > Especially, if by "certain set", you mean that these are pre-defined > values, you could create your filters at start-up time and use > CachingWrapperFilter to keep them around. > > Either way, I suspect it would be much simpler. > > Best > Erick > > > On 6/10/07, lucene user wrote: > > > > I am trying to use a Filter Index Reader to > > provide access only to the subset of my archive > > for which a certain field contains one of a given > > list of values. > > > > The idea is to create a special term for this field > > that means 'any term in the list', and add an 'AND' > > clause to every query, to enforce the condition. > > > > I override the seek() and next() methods of FilterTermDocs. > > > > In the seek(Term t) method I check if t is my special term. > > If it is, I initialize an instance variable in the FilterTermDocs, > > with an Iterator over my List. I then call super.seek(s) for > > a term 's' which has the same field name and a value which > > is the next element from the interator. > > > > In the next() method, If super.next() returns false, > > but the iterator is there and has a next element, > > I call super.seek(s) for the next element and try > > again. > > > > The problem is the although my seek() method is being called, > > my next() method is not. Thus I never get to iterate through > > my list, and only receive results corrasponding to its first > > element. > > > ------=_Part_73280_16482305.1181537178607--