public class ScoreFunction extends Object
Each ScoreFunction is a scoring function, and currently, up to three ScoreFunctions can be used simultaneously for scoring.
Each ScoreFunction includes three types of functions: FieldValueFactorFunction, DecayFunction, and RandomFunction. Please select one of these to configure or leave all unset (use only filter and weight).
The ScoreFunction can set weight and filter, controlling the weight of the scoring (the result of the function scoring will be multiplied by weight) and filtering the scoring objects (only docs that pass the filter will be scored by this function).
| 限定符和类型 | 类和说明 |
|---|---|
static class |
ScoreFunction.Builder |
| 构造器和说明 |
|---|
ScoreFunction() |
ScoreFunction(Float weight,
Query filter,
FieldValueFactorFunction fieldValueFactorFunction,
DecayFunction decayFunction,
RandomFunction randomFunction) |
| 限定符和类型 | 方法和说明 |
|---|---|
DecayFunction |
getDecayFunction() |
FieldValueFactorFunction |
getFieldValueFactorFunction() |
Query |
getFilter() |
RandomFunction |
getRandomFunction() |
Float |
getWeight() |
static ScoreFunction.Builder |
newBuilder() |
void |
setDecayFunction(DecayFunction decayFunction) |
void |
setFieldValueFactorFunction(FieldValueFactorFunction fieldValueFactorFunction) |
void |
setFilter(Query filter) |
void |
setRandomFunction(RandomFunction randomFunction) |
void |
setWeight(Float weight) |
public ScoreFunction()
public ScoreFunction(Float weight, Query filter, FieldValueFactorFunction fieldValueFactorFunction, DecayFunction decayFunction, RandomFunction randomFunction)
public Float getWeight()
public void setWeight(Float weight)
public Query getFilter()
public void setFilter(Query filter)
public FieldValueFactorFunction getFieldValueFactorFunction()
public void setFieldValueFactorFunction(FieldValueFactorFunction fieldValueFactorFunction)
public DecayFunction getDecayFunction()
public void setDecayFunction(DecayFunction decayFunction)
public RandomFunction getRandomFunction()
public void setRandomFunction(RandomFunction randomFunction)
public static ScoreFunction.Builder newBuilder()
Copyright © 2025. All Rights Reserved.