lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Michael McCandless <luc...@mikemccandless.com>
Subject Re: lengthNorm method of Similarity not beeing called
Date Mon, 07 Aug 2006 12:03:40 GMT

> At this post Erik says:
> 
> "Sure, you can subclass DefaultSimilarity and override and tweak just
> the lengthNorm() method. Be sure to use IndexWriter.setSimilarity()
> to get your custom one used."
> 
> Well, I traced my own method lengthNorm and realized that this method is not being called.

The lengthNorm() method, I believe, is only called during indexing.  Its 
purpose is to translate the number of terms that occurred in a given 
field, into a score factor that is used at query time.

Can you verify that you called IndexWriter.setSimilarity() (as above) 
before adding documents to the index?  And then see if your lengthNorm() 
is then being called?

Mike

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


Mime
View raw message