public class CustomSimilarity
extends org.apache.lucene.search.similarities.ClassicSimilarity
Constructor and Description |
---|
CustomSimilarity() |
Modifier and Type | Method and Description |
---|---|
float |
coord(int overlap,
int maxOverlap)
In JCMS, document fields are used for title/abstract/allfield, but contrary
to the default behavior of Lucene similarity, if a match occured in several
of those field as compared to only one, it should not change the score.
|
float |
lengthNorm(org.apache.lucene.index.FieldInvertState state)
We do not want long text to be less important than short text.
|
decodeNormValue, encodeNormValue, getDiscountOverlaps, idf, idfExplain, queryNorm, scorePayload, setDiscountOverlaps, sloppyFreq, tf, toString
public float lengthNorm(org.apache.lucene.index.FieldInvertState state)
lengthNorm
in class org.apache.lucene.search.similarities.ClassicSimilarity
public float coord(int overlap, int maxOverlap)
Indeed, the field boost already takes care of the higher relevance of title vs abstract vs other.
coord
in class org.apache.lucene.search.similarities.ClassicSimilarity
Copyright © 2001-2018 Jalios SA. All Rights Reserved.