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 http://www.thetaphi.de eMail: u...@thetaphi.de > -----Original Message----- > From: ysee...@gmail.com [mailto:ysee...@gmail.com] On Behalf Of Yonik > Seeley > Sent: Thursday, November 19, 2009 3:29 PM > To: Daniel Noll > Cc: java-user@lucene.apache.org > Subject: Re: Finding the highest term in a field > > On Thu, Nov 19, 2009 at 1:04 AM, Daniel Noll <dan...@nuix.com> 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 > http://www.lucidimagination.com > > --------------------------------------------------------------------- > To unsubscribe, e-mail: java-user-unsubscr...@lucene.apache.org > For additional commands, e-mail: java-user-h...@lucene.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: java-user-unsubscr...@lucene.apache.org For additional commands, e-mail: java-user-h...@lucene.apache.org