lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Tony Schwartz" <t...@simpleobjects.com>
Subject Re: Finding minimum and maximum value of a field?
Date Tue, 31 May 2005 12:10:34 GMT
Only way I see to do this is to get a TermEnum for that field, and grab the first.  Then
iterate until you find the last one.  This is similar behavior to the TermEnum.skipTo
method.  A better solution would be to record the minimum and maximum dates in the index
as you index them.  Each time you insert a new date, update the min/max if needed.  This
data would reside outside the index of course.


Tony Schwartz
tony@simpleobjects.com
"What we need is more cowbell."

> I have an index with a date field.  I want to quickly find the minimum
> and maximum values in the index.
>
> Is there a quick way to do this?  I looked at using TermInfos and
> finding the first one but how to I find the last?
>
> I also tried the new sort API and the performance was horrible :-/
>
> Any ideas?
>
> Kevin
>
> --
>
>
> Use Rojo (RSS/Atom aggregator)! - visit http://rojo.com.
> See irc.freenode.net #rojo if you want to chat.
>
> Rojo is Hiring! - http://www.rojonetworks.com/JobsAtRojo.html
>
>    Kevin A. Burton, Location - San Francisco, CA
>       AIM/YIM - sfburtonator,  Web - http://peerfear.org/
> GPG fingerprint: 5FB2 F3E2 760E 70A8 6174 D393 E84D 8D04 99F1 4412
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
> For additional commands, e-mail: java-user-help@lucene.apache.org
>
>


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