Return-Path: Delivered-To: apmail-lucene-general-archive@www.apache.org Received: (qmail 98791 invoked from network); 27 Oct 2006 11:38:07 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 27 Oct 2006 11:38:07 -0000 Received: (qmail 48661 invoked by uid 500); 27 Oct 2006 11:38:17 -0000 Delivered-To: apmail-lucene-general-archive@lucene.apache.org Received: (qmail 48641 invoked by uid 500); 27 Oct 2006 11:38:17 -0000 Mailing-List: contact general-help@lucene.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: general@lucene.apache.org Delivered-To: mailing list general@lucene.apache.org Received: (qmail 48630 invoked by uid 99); 27 Oct 2006 11:38:17 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 27 Oct 2006 04:38:17 -0700 X-ASF-Spam-Status: No, hits=0.5 required=10.0 tests=DNS_FROM_RFC_ABUSE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (herse.apache.org: domain of regebro@gmail.com designates 66.249.92.169 as permitted sender) Received: from [66.249.92.169] (HELO ug-out-1314.google.com) (66.249.92.169) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 27 Oct 2006 04:38:05 -0700 Received: by ug-out-1314.google.com with SMTP id k40so674715ugc for ; Fri, 27 Oct 2006 04:37:44 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=IjKXTvgSGiuyaxrFIipJ2x6z5NM8K3jZDAcWsISTMcY0vn++nIyOJnc/hD0d5GDvsphLfv159ec9QyuisHwebX3XseC+Hh4KJ9cdH1ftkNE7XGUu8LOW9NKL+yPSSzSDsKhRS3GHIlOFINT+HVEf/bir+mrq4qkd1h0LE7+40QM= Received: by 10.78.127.6 with SMTP id z6mr3671791huc; Fri, 27 Oct 2006 04:37:43 -0700 (PDT) Received: by 10.78.115.12 with HTTP; Fri, 27 Oct 2006 04:37:43 -0700 (PDT) Message-ID: <319e029f0610270437x52642fdfhc9c5199854fa9fb7@mail.gmail.com> Date: Fri, 27 Oct 2006 13:37:43 +0200 From: "Lennart Regebro" To: general@lucene.apache.org Subject: Re: Getting the terms for a particular field. In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <319e029f0610250538t6516dd69mcec556b0f8a670c6@mail.gmail.com> X-Virus-Checked: Checked by ClamAV on apache.org On 10/25/06, Chris Hostetter wrote: > > : The best I have come up with so far is to go through all the terms > : gotten from the IndexReader.terms() and filter on field(). That works > > you're basically on it, but look at the IndexReader.terms(Term) method > which allows you to start with a specific term, and then bear in mind that > the TermEnum goes in order, which means all of the terms for a single > field will come sequentially, so as soon as you see a field name other > then the one you are interested in, you know you can stop. > > if you look at the code for RangeFilter you'll see a good example of > iterating over a TermEnum for a single field ... what you want is > effectively the same the work RangeFilter would do when the bounds are > both null. That works fine, thanks for the help! -- Lennart Regebro, Nuxeo http://www.nuxeo.com/ CPS Content Management http://www.nuxeo.org/