lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Uwe Schindler" <>
Subject RE: Finding the highest term in a field
Date Thu, 19 Nov 2009 14:39:15 GMT
Hi Daniel, hi Yonik,

With NumericFields it would be possible to get faster to the really last
position in the TermEnum. It would be possible to iterate first over the
lowest precision terms until the end is reached. By that you know the prefix
of the last term. You can then place the TermEnum on the first term with the
same prefix, but the next better precision and iterate again. You do this
until you are in the highest precision. Depending on the precStep value you
can find the end much faster. E.g. with the default precStep of 4, each
precision needs to enumerate a theoretical maximum of 16 terms and then go
to the next lower prec. With 32 bit its, you need to do this 8 times, so you
need to iterate as maximum (but never in reality), 16*8 terms.

To implement this, you need much knowledge about NumericFields, but it is
possible with an very simple algorithm (simplier than the range splitter in
NumericUtils). If you like, I could possibly help you to implement this.

Uwe Schindler
H.-H.-Meier-Allee 63, D-28213 Bremen

> -----Original Message-----
> From: [] On Behalf Of Yonik
> Seeley
> Sent: Thursday, November 19, 2009 3:29 PM
> To: Daniel Noll
> Cc:
> Subject: Re: Finding the highest term in a field
> On Thu, Nov 19, 2009 at 1:04 AM, Daniel Noll <> wrote:
> > I take it the existing numeric fields can't already do stuff like
> > this?
> Nope, it's a fundamental limitation of the current TermEnums.
> -Yonik
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
> For additional commands, e-mail:

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

View raw message