You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@lucene.apache.org by John Smith <jo...@yahoo.com> on 2006/04/06 20:15:19 UTC

Question related to using FieldCacheImpl

Hi
   
  I need to access min and max values of a particular field in the index, as soon as a searcher is initialized. I don't need it later. Looking at old newsgroup mails, I found a few recommendations.
   
  One was to keep the min and max fields external to the index. But this will not work for us. 
   
  Then there was the recommendation to use FieldCacheImpl, as sorting might be a little expensive. Looking at FieldCacheImpl implementation, I had a couple of questions. Sorry if this has been asked and answered before.
   
  If I use this method
   
   // inherit javadocs
  public String[] getStrings (IndexReader reader, String field)

  The string array I get back, is it guaranteed that the first non-null value I encounter in the array is the minimum value for this field and iterating through the array in the reverse order, the first non-null value I encounter is the max value for the field?
   
  Thank you
   
  JS
   
   
   

			
---------------------------------
Yahoo! Messenger with Voice. PC-to-Phone calls for ridiculously low rates.

Re: Question related to using FieldCacheImpl

Posted by John Smith <jo...@yahoo.com>.
Thank you

JS

--- Yonik Seeley <ys...@gmail.com> wrote:

> On 4/6/06, John Smith <jo...@yahoo.com>
> wrote:
> >    // inherit javadocs
> >   public String[] getStrings (IndexReader reader,
> String field)
> >
> >   The string array I get back, is it guaranteed
> that the first non-null value I encounter in the
> array is the minimum value for this field and
> iterating through the array in the reverse order,
> the first non-null value I encounter is the max
> value for the field?
> 
> 
> I think you want getStringIndex()
> StringIndex.lookup[1] is the first value,
> lookup[lookup.length-1] is the last.
> 
> 
> -Yonik
> http://incubator.apache.org/solr Solr, The Open
> Source Lucene Search Server
> 
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> java-user-unsubscribe@lucene.apache.org
> For additional commands, e-mail:
> java-user-help@lucene.apache.org
> 
> 


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org


Re: Question related to using FieldCacheImpl

Posted by Yonik Seeley <ys...@gmail.com>.
On 4/6/06, John Smith <jo...@yahoo.com> wrote:
>    // inherit javadocs
>   public String[] getStrings (IndexReader reader, String field)
>
>   The string array I get back, is it guaranteed that the first non-null value I encounter in the array is the minimum value for this field and iterating through the array in the reverse order, the first non-null value I encounter is the max value for the field?


I think you want getStringIndex()
StringIndex.lookup[1] is the first value, lookup[lookup.length-1] is the last.


-Yonik
http://incubator.apache.org/solr Solr, The Open Source Lucene Search Server

---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org