Class FieldValueFactorFunction
java.lang.Object
org.elasticsearch.common.lucene.search.function.ScoreFunction
org.elasticsearch.common.lucene.search.function.FieldValueFactorFunction
A function_score function that multiplies the score with the value of a
field from the document, optionally multiplying the field by a factor first,
and applying a modification (log, ln, sqrt, square, etc) afterwards.
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic enum
The Type class encapsulates the modification types that can be applied to the score/value product. -
Constructor Summary
ConstructorDescriptionFieldValueFactorFunction
(String field, float boostFactor, FieldValueFactorFunction.Modifier modifierType, Double missing, IndexNumericFieldData indexFieldData) -
Method Summary
Modifier and TypeMethodDescriptionprotected boolean
doEquals
(ScoreFunction other) Indicates whether some otherScoreFunction
object of the same type is "equal to" this one.protected int
getLeafScoreFunction
(org.apache.lucene.index.LeafReaderContext ctx) boolean
Indicates if document scores are needed by this function.Methods inherited from class org.elasticsearch.common.lucene.search.function.ScoreFunction
equals, getDefaultScoreCombiner, getWeight, hashCode, rewrite
-
Constructor Details
-
FieldValueFactorFunction
public FieldValueFactorFunction(String field, float boostFactor, FieldValueFactorFunction.Modifier modifierType, Double missing, IndexNumericFieldData indexFieldData)
-
-
Method Details
-
getLeafScoreFunction
- Specified by:
getLeafScoreFunction
in classScoreFunction
-
needsScores
public boolean needsScores()Description copied from class:ScoreFunction
Indicates if document scores are needed by this function.- Specified by:
needsScores
in classScoreFunction
- Returns:
true
if scores are needed.
-
doEquals
Description copied from class:ScoreFunction
Indicates whether some otherScoreFunction
object of the same type is "equal to" this one.- Specified by:
doEquals
in classScoreFunction
-
doHashCode
protected int doHashCode()- Specified by:
doHashCode
in classScoreFunction
-