lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Yonik Seeley <yo...@lucidimagination.com>
Subject Re: Retrieving the first document in a range
Date Tue, 05 Apr 2011 14:36:27 GMT
On Tue, Apr 5, 2011 at 10:06 AM, Shai Erera <serera@gmail.com> wrote:
> Can we use TermEnum to skip to the first term 'after 3 weeks'? If so, we can
> pull the first doc that appears in the TermDocs of that Term (if it's a
> valid term).

Yep.  Try this to get the term you want to use to seek:
        BytesRef term = new BytesRef();
        NumericUtils.longToPrefixCoded(longval, 0, term);


-Yonik
http://www.lucenerevolution.org -- Lucene/Solr User Conference, May
25-26, San Francisco

---------------------------------------------------------------------
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