Hi Otis,
I customized the Similarity class and add it through the end of schema.xml:
... ...
  <solrQueryParser defaultOperator="OR"/>
  <similarity class="mypackage.NoTfSimilarity"/>
</schema>

and mypackage.NoTfSimilarity.java is like:

public class NoTfSimilarity extends DefaultSimilarity
{
    public float tf(float freq)
    {
        return freq > 0 ? 1.0f : 0.0f;
    }

    public float idf(int docFreq, int numDocs)
    {
        return docFreq > 0 ? 1.0f : 0.0f;
    }

}

I deploy the class in
.../tomcat/webapps/solr/WEB-INF/classes/mypackage/NoTfSimilarity.class

restart tomcat.

I ran the benchmark with indexing same set of data, comparing to results
previous to the change, the .frq files size remain the same. Also the query
still shows the scores being calculated:
... ...
<doc><float name="score">0.8838835</float> 
... ...

any idea what I am missing here? seems it is not using my customized
similarity class.
thanks
jie



--
View this message in context: 
http://lucene.472066.n3.nabble.com/if-I-only-need-exact-search-does-frequency-score-matter-tp4026893p4028125.html
Sent from the Solr - User mailing list archive at Nabble.com.

Reply via email to