lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Michael McCandless <luc...@mikemccandless.com>
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).

Mike

On Fri, Feb 18, 2011 at 9:24 PM, Jason Rutherglen
<jason.rutherglen@gmail.com> 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: 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


Mime
View raw message