lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Erik Hatcher <>
Subject Re: score and frequency
Date Fri, 04 Jun 2004 08:25:22 GMT
On Jun 4, 2004, at 2:52 AM, Niraj Alok wrote:
> Hi,
> I am having some problems with the score of lucene.
> I am trying to get the results displayed according to hits.score and 
> it is giving the results correctly.
> However I do not want the frequency factor to be used for the 
> computation of the score.
> Is it possible to get the score which does not have the frequency 
> factor in it ?

Have a look at the javadocs for Similarity.  DefaultSimilarity is used 
unless otherwise specified.  You could subclass that and override this:

   public float tf(float freq) {
     return (float)Math.sqrt(freq);

and return 1.0.  This might give you the effect you want.


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message