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 Philippe <ma...@gmail.com> on 2010/07/19 15:53:25 UTC

Get lengthNorm of a field

Hi,

is there a possibility to retrieve the lengthNorm for all (or a 
specific) fields in a specific document?

Regards,
     Philippe

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


Re: Get lengthNorm of a field

Posted by Philippe <ma...@gmail.com>.
Hi Yonik,

Am 19.07.2010 16:21, schrieb Yonik Seeley:
> On Mon, Jul 19, 2010 at 9:53 AM, Philippe<ma...@gmail.com>  wrote:
>    
>> is there a possibility to retrieve the lengthNorm for all (or a specific)
>> fields in a specific document?
>>      
> See IndexReader: public abstract byte[] norms(String field) throws IOException;
> And Similarity: public float decodeNormValue(byte b) {
>
> The byte[] is indexed by document id, and you can decode that into a
> float value with a Similarity.
>    
Thanks for the quick reply. I was searching for methods in 
IndexSearcher. Therefore I did not find the norms method.

Cheers,
     Philippe

> -Yonik
> http://www.lucidimagination.com
>
>
>
>
>    
>> Regards,
>>     Philippe
>>
>> ---------------------------------------------------------------------
>> 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
>
>
>    


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


Re: Get lengthNorm of a field

Posted by Yonik Seeley <yo...@lucidimagination.com>.
On Mon, Jul 19, 2010 at 9:53 AM, Philippe <ma...@gmail.com> wrote:
> is there a possibility to retrieve the lengthNorm for all (or a specific)
> fields in a specific document?

See IndexReader: public abstract byte[] norms(String field) throws IOException;
And Similarity: public float decodeNormValue(byte b) {

The byte[] is indexed by document id, and you can decode that into a
float value with a Similarity.

-Yonik
http://www.lucidimagination.com




> Regards,
>    Philippe
>
> ---------------------------------------------------------------------
> 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