Return-Path: Delivered-To: apmail-lucene-java-user-archive@www.apache.org Received: (qmail 20647 invoked from network); 19 Feb 2011 13:43:04 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 19 Feb 2011 13:43:04 -0000 Received: (qmail 50746 invoked by uid 500); 19 Feb 2011 13:43:02 -0000 Delivered-To: apmail-lucene-java-user-archive@lucene.apache.org Received: (qmail 50394 invoked by uid 500); 19 Feb 2011 13:42:59 -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 50381 invoked by uid 99); 19 Feb 2011 13:42:57 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 19 Feb 2011 13:42:57 +0000 X-ASF-Spam-Status: No, hits=-0.7 required=5.0 tests=FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of jason.rutherglen@gmail.com designates 209.85.216.48 as permitted sender) Received: from [209.85.216.48] (HELO mail-qw0-f48.google.com) (209.85.216.48) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 19 Feb 2011 13:42:51 +0000 Received: by qwe4 with SMTP id 4so4176106qwe.35 for ; Sat, 19 Feb 2011 05:42:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=CCc8OBhYnJC0DnHozG89hVc3Zvv5X2HxWqjVYNVK8n8=; b=cvEBVZPi+j+5FvO1OHIVKtbLy7Mj29Q7+PmHMnufUpPcI9CZ3+Haww+aJFgI2d/xrl z2tst6YJ55yrwx6WBeggSD/n2PKmtYYJ0sHvjNYmEClTbDCE9mIbuXSunIKdr++LMosr OsiutAkQOQGVyGyRsy/zIzMs7/0kbUaLjIVPU= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=izSMx/FZgzU4K0V9tB15jiBJ4rhNEjkHSIM7jrcIFjMvKKj8qFKcGYG1YUJfq/muCs O/knYA8VsZDkS6ZE4xP0SrgdxbnPwyq2vsWjtkXBb9oQ8KgM88hN0/+FTTg/Jz43LgZi VCwz26OSUzU1X2UqgfmAagy2unkcGoT2BzVh0= MIME-Version: 1.0 Received: by 10.229.189.4 with SMTP id dc4mr1405502qcb.173.1298122949987; Sat, 19 Feb 2011 05:42:29 -0800 (PST) Received: by 10.229.65.198 with HTTP; Sat, 19 Feb 2011 05:42:29 -0800 (PST) In-Reply-To: References: Date: Sat, 19 Feb 2011 05:42:29 -0800 Message-ID: Subject: Re: Last/max term in Lucene 4.x From: Jason Rutherglen To: Michael McCandless Cc: java-user@lucene.apache.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Virus-Checked: Checked by ClamAV on apache.org > Instead of docFreq, did you mean numUniqueTerms? Right. > But you have to > use a terms index impl that supports ord (eg FixedGap). Ok, and the VariableGap is the new standard because the FST is much more efficient as a terms index? Perhaps I'd need to create a codec (or patch the existing) to automatically store the max term? On Sat, Feb 19, 2011 at 3:33 AM, Michael McCandless wrote: > I don't quite understand your question Jason... > > Seeking to the first term of the field just gets you the smallest term > (in unsigned byte[] order, ie Unicode order if the byte[] is UTF8) > across all docs. > > Instead of docFreq, did you mean numUniqueTerms? =A0Ie, you want to seek > to the largest term for that field? =A0In which case, yes seeking by > term ord to numUniqueTerms-1 gets you to that term. =A0But you have to > use a terms index impl that supports ord (eg FixedGap). > > Mike > > On Fri, Feb 18, 2011 at 9:24 PM, Jason Rutherglen > wrote: >> This could be a rhetorical question. =A0The way to find the last/max >> term that is a unique per document is to use TermsEnum to seek to the >> first term of a field, then call seek to the docFreq-1 for the last >> ord, then get the term, or is there a better/faster way? >> >> --------------------------------------------------------------------- >> To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org >> For additional commands, e-mail: java-user-help@lucene.apache.org >> >> > > > > -- > Mike > > http://blog.mikemccandless.com > --------------------------------------------------------------------- To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org For additional commands, e-mail: java-user-help@lucene.apache.org