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 Claudio Gennaro <cl...@isti.cnr.it> on 2009/08/10 09:55:56 UTC

sumOfSquaredWeights for lengthNorm

Dear all,

 

I read a very old message on the list about the use of sumOfSquaredWeights
in lengthNorm (Mon, 06 Mar 2006 19:06:28 GMT from Eugene). I just wanted to
do the same, i.e., to override the Similarity class of Lucene in order to
normalize the term weights of a doc with the sum of the squares of doc term
frequencies in the doc. 

 

Cheers

 

Claudio

 


R: sumOfSquaredWeights for lengthNorm

Posted by Claudio Gennaro <cl...@isti.cnr.it>.
Yes, this is probably the right way, but the problem is how. The method
lengthNorm(String fieldName, int numTerms) of the Similarity Class takes as
input parameter only the number of terms of the current doc being indexed.
Instead, I need the evaluate the sum of the squared of the distinct term
frequencies.

Claudio

-----Messaggio originale-----
Da: Grant Ingersoll [mailto:gsingers@apache.org] 
Inviato: lunedì 10 agosto 2009 15.18
A: java-user@lucene.apache.org
Oggetto: Re: sumOfSquaredWeights for lengthNorm

You can override the Similarity class and set it on both the  
IndexWriter and the IndexReader.   Is that your question?

On Aug 10, 2009, at 3:55 AM, Claudio Gennaro wrote:

> Dear all,
>
>
>
> I read a very old message on the list about the use of  
> sumOfSquaredWeights
> in lengthNorm (Mon, 06 Mar 2006 19:06:28 GMT from Eugene). I just  
> wanted to
> do the same, i.e., to override the Similarity class of Lucene in  
> order to
> normalize the term weights of a doc with the sum of the squares of  
> doc term
> frequencies in the doc.
>


---------------------------------------------------------------------
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: sumOfSquaredWeights for lengthNorm

Posted by Grant Ingersoll <gs...@apache.org>.
You can override the Similarity class and set it on both the  
IndexWriter and the IndexReader.   Is that your question?

On Aug 10, 2009, at 3:55 AM, Claudio Gennaro wrote:

> Dear all,
>
>
>
> I read a very old message on the list about the use of  
> sumOfSquaredWeights
> in lengthNorm (Mon, 06 Mar 2006 19:06:28 GMT from Eugene). I just  
> wanted to
> do the same, i.e., to override the Similarity class of Lucene in  
> order to
> normalize the term weights of a doc with the sum of the squares of  
> doc term
> frequencies in the doc.
>


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