public class CmsSearchSimilarity
extends org.apache.lucene.search.similarities.DefaultSimilarity
lengthNorm(FieldInvertState)
factor
for the CmsSearchField.FIELD_CONTENT
field, while
keeping the Lucene default for all other fields.This implementation was added since apparently the default length norm is heavily biased for small documents. In the default, even if a term is found in 2 documents the same number of times, the smaller document (containing less terms) will have a score easily 3x as high as the longer document. Using this implementation the importance of the term number is reduced.
Inspired by Chuck Williams WikipediaSimilarity.
构造器和说明 |
---|
CmsSearchSimilarity()
Creates a new instance of the OpenCms search similarity.
|
限定符和类型 | 方法和说明 |
---|---|
float |
lengthNorm(org.apache.lucene.index.FieldInvertState state)
Special implementation for "compute norm" to reduce the significance of this factor
for the
field, while
keeping the Lucene default for all other fields. |
coord, getDiscountOverlaps, idf, queryNorm, scorePayload, setDiscountOverlaps, sloppyFreq, tf, toString
public CmsSearchSimilarity()
public float lengthNorm(org.apache.lucene.index.FieldInvertState state)
CmsSearchField.FIELD_CONTENT
field, while
keeping the Lucene default for all other fields.lengthNorm
在类中 org.apache.lucene.search.similarities.DefaultSimilarity