lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From andi rexha <a_re...@hotmail.com>
Subject RE: Cache Field Lucene 3.6.0
Date Tue, 30 Jul 2013 14:19:47 GMT
Hi Adrien,
Thank you very much. I will have a look on your suggestion ;)


> From: jpountz@gmail.com
> Date: Tue, 30 Jul 2013 16:16:03 +0200
> Subject: Re: Cache Field Lucene 3.6.0
> To: java-user@lucene.apache.org
> 
> Hi,
> 
> On Tue, Jul 30, 2013 at 4:09 PM, andi rexha <a_rexha@hotmail.com> wrote:
> > Hi, I have a stored and tokenized field, and I want to cache all the field values.
> >
> > I have one document in the index, with the  "field.value"  =>   "hello world"
  and with tokens   => "hello", "world".
> > I try to extract the fields content :
> > String [] cachedFields  =  FieldCache.DEFAULT.getStrings(reader, field.getName());
> >
> > The content of the cachedFields array is ["hello"].
> >
> > When I try to index other documents, I get also "null" as the value of the field.
> >
> > Can somebody help me with that?
> 
> Lucene 3.6's field cache was created for sorting on single-valued
> fields, this is why it only stores one token per field per document
> and isn't suitable for multi-valued fields.
> 
> If you need such an API for multi-valued fields, I recommend upgrading
> to Lucene 4 and using SortedSetDocValues[1].
> 
> [1] http://lucene.apache.org/core/4_4_0/core/org/apache/lucene/index/AtomicReader.html#getSortedSetDocValues%28java.lang.String%29
> 
> -- 
> Adrien
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
> For additional commands, e-mail: java-user-help@lucene.apache.org
> 
 		 	   		  
Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message