Package com.jalios.jcms.search
Class CustomSimilarity
- java.lang.Object
-
- org.apache.lucene.search.similarities.Similarity
-
- org.apache.lucene.search.similarities.TFIDFSimilarity
-
- org.apache.lucene.search.similarities.ClassicSimilarity
-
- com.jalios.jcms.search.CustomSimilarity
-
public class CustomSimilarity extends org.apache.lucene.search.similarities.ClassicSimilarity
Custom scoring implementation.
-
-
Constructor Summary
Constructors Constructor Description CustomSimilarity()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description float
lengthNorm(int numTerms)
We do not want long text to be less important than short text.-
Methods inherited from class org.apache.lucene.search.similarities.ClassicSimilarity
idf, idfExplain, scorePayload, sloppyFreq, tf, toString
-
-
-
-
Method Detail
-
lengthNorm
public float lengthNorm(int numTerms)
We do not want long text to be less important than short text. Therefore always return 1 for this normalization value to have no impact. This value is computed during indexing and stored in the index.- Overrides:
lengthNorm
in classorg.apache.lucene.search.similarities.ClassicSimilarity
-
-