lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From escher2k <>
Subject Similarity modification...
Date Thu, 04 Jan 2007 02:23:39 GMT

  I am trying to create a linear function  to influence the similarity
computation. For example -
if tf = 4, f(tf) = 150 * 1 + 150 * 0.3 
                    = 195

The first occurrence is multiplied by 150. The next three occurrences are
mulitplied by 150 and
divided by 10 (3/10).

However, we don't have access to the field name in the function public float
tf(float freq).
Then I thought of modifying the lengthNorm, but there is no input variable
there to 
get the term frequency public float lengthNorm(String fieldName, int
numTerms). Is there
any way out ? Is it safe to add a class variable that will save the term
frequency that can be reused
by lengthNorm (assuming that a new Similarity object is constructed for
every request) ?

View this message in context:
Sent from the Lucene - Java Users mailing list archive at

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

View raw message