Passing in new BytesRef(), I always get back an empty string.  So clearly the 
comment *is* correct, and neither you nor I know how to do this properly. ;-)

Any other suggestions?

Karl

-----Original Message-----
From: Wright Karl (Nokia-MS/Cambridge) 
Sent: Wednesday, August 18, 2010 11:28 AM
To: 'dev@lucene.apache.org'
Subject: RE: Question about string retrieval with FieldCache in trunk

If you are correct, the comment is certainly incorrect, since it implies that 
the SAME BytesRef is returned as you pass in.
Karl

-----Original Message-----
From: ext Jason Rutherglen [mailto:jason.rutherg...@gmail.com] 
Sent: Wednesday, August 18, 2010 11:27 AM
To: dev@lucene.apache.org
Cc: yo...@lucidimagination.com
Subject: Re: Question about string retrieval with FieldCache in trunk

Karl,

I believe one may pass an empty BytesRef in, and the values will be
set within the getTerm method.

On Wed, Aug 18, 2010 at 8:18 AM,  <karl.wri...@nokia.com> wrote:
> Exactly. getTerms() returns a DocTerms, which has this:
>
>    /** The BytesRef argument must not be null; the method
>     *  returns the same BytesRef, or an empty (length=0)
>     *  BytesRef if the doc did not have this field or was
>     *  deleted. */
>    public abstract BytesRef getTerm(int docID, BytesRef ret);
>
> How in the blazes do you create the correct BytesRef in the first place?  Or 
> is the comment wrong?
>
> Karl
>
>
> -----Original Message-----
> From: ysee...@gmail.com [mailto:ysee...@gmail.com] On Behalf Of ext Yonik 
> Seeley
> Sent: Wednesday, August 18, 2010 10:55 AM
> To: dev@lucene.apache.org
> Subject: Re: Question about string retrieval with FieldCache in trunk
>
> Check out getTerms and getTermsIndex
>
> -Yonik
> http://www.lucidimagination.com
>
> On Wed, Aug 18, 2010 at 10:49 AM,  <karl.wri...@nokia.com> wrote:
>> Hi folks,
>>
>> What is the proper way to retrieve a string field from lucene in trunk?  I'm
>> specifically looking for the equivalent of:
>>
>> String[] fieldValues = FieldCache.DEFAULT.getStrings(reader,fieldName);
>> String actualValue = fieldValues[luceneID-docBase];
>>
>> The getStrings() method seems to have gone away in FieldCache.java, and it's
>> not clear how to work with ByteRefs to do the equivalent.  Any hints?
>>
>> Karl
>>
>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org
> For additional commands, e-mail: dev-h...@lucene.apache.org
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org
> For additional commands, e-mail: dev-h...@lucene.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org
For additional commands, e-mail: dev-h...@lucene.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org
For additional commands, e-mail: dev-h...@lucene.apache.org

Reply via email to