lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Michael McCandless <>
Subject Re: Last/max term in Lucene 4.x
Date Sat, 19 Feb 2011 11:33:10 GMT
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?  Ie, you want to seek
to the largest term for that field?  In which case, yes seeking by
term ord to numUniqueTerms-1 gets you to that term.  But you have to
use a terms index impl that supports ord (eg FixedGap).


On Fri, Feb 18, 2011 at 9:24 PM, Jason Rutherglen
<> wrote:
> This could be a rhetorical question.  The 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:
> For additional commands, e-mail:


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message