lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From John Wang <john.w...@gmail.com>
Subject Re: Finding minimum and maximum value of a field?
Date Tue, 07 Jun 2005 16:34:41 GMT
You can try to load the fieldcache:

if you get the StringIndex from the fieldcache, the last element in
the lookup array is the largest value (lexically) in the field.

-John


On 6/7/05, sergiu gordea <gsergiu@ifit.uni-klu.ac.at> wrote:
> 
> 
> Kevin Burton wrote:
> 
> > 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?
> 
> You may keep a history of the MIN and MAX values in an external file.
> Let's say, you can write in a text file the MIN_DATE and MAX_DATE,
> and keep them up to date when indexing, deleting documents.
> 
> Best,
> 
>  Sergiu
> 
> >
> > Kevin
> >
> 
> 
> ---------------------------------------------------------------------
> 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