|
||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.lucene.search.Similarity
org.apache.lucene.search.DefaultSimilarity
org.opencms.search.CmsSearchSimilarity
public class CmsSearchSimilarity
Reduces the importance of the
factor
for the lengthNorm(String, int)
field, while
keeping the Lucene default for all other fields.CmsSearchField.FIELD_CONTENT
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.
Constructor Summary | |
---|---|
CmsSearchSimilarity()
Creates a new instance of the OpenCms search similarity. |
Method Summary | |
---|---|
float |
lengthNorm(java.lang.String fieldName,
int numTerms)
Special implementation for "length norm" to reduce the significance of this factor for the field, while
keeping the Lucene default for all other fields. |
Methods inherited from class org.apache.lucene.search.DefaultSimilarity |
---|
coord, idf, queryNorm, sloppyFreq, tf |
Methods inherited from class org.apache.lucene.search.Similarity |
---|
decodeNorm, encodeNorm, getDefault, getNormDecoder, idf, idf, scorePayload, setDefault, tf |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public CmsSearchSimilarity()
Method Detail |
---|
public float lengthNorm(java.lang.String fieldName, int numTerms)
CmsSearchField.FIELD_CONTENT
field, while
keeping the Lucene default for all other fields.
lengthNorm
in class org.apache.lucene.search.DefaultSimilarity
Similarity.lengthNorm(java.lang.String, int)
|
||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |