Class WeightFactorFunction
java.lang.Object
org.opensearch.common.lucene.search.function.ScoreFunction
org.opensearch.common.lucene.search.function.WeightFactorFunction
Weight factor function
- Opensearch.internal:
-
Constructor Summary
ConstructorDescriptionWeightFactorFunction
(float weight) WeightFactorFunction
(float weight, String functionName) WeightFactorFunction
(float weight, ScoreFunction scoreFunction) WeightFactorFunction
(float weight, ScoreFunction scoreFunction, String functionName) -
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
org.apache.lucene.search.Explanation
getLeafScoreFunction
(org.apache.lucene.index.LeafReaderContext ctx) float
boolean
Indicates if document scores are needed by this function.Methods inherited from class org.opensearch.common.lucene.search.function.ScoreFunction
equals, getDefaultScoreCombiner, hashCode, rewrite
-
Constructor Details
-
WeightFactorFunction
-
WeightFactorFunction
public WeightFactorFunction(float weight, ScoreFunction scoreFunction, @Nullable String functionName) -
WeightFactorFunction
public WeightFactorFunction(float weight) -
WeightFactorFunction
-
-
Method Details
-
getLeafScoreFunction
public LeafScoreFunction getLeafScoreFunction(org.apache.lucene.index.LeafReaderContext ctx) throws IOException - Specified by:
getLeafScoreFunction
in classScoreFunction
- Throws:
IOException
-
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.
-
explainWeight
public org.apache.lucene.search.Explanation explainWeight() -
getWeight
public float getWeight()- Overrides:
getWeight
in classScoreFunction
-
getScoreFunction
-
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
-