Package org.opensearch.index.query
Class RankFeatureQueryBuilders
java.lang.Object
org.opensearch.index.query.RankFeatureQueryBuilders
-
Method Summary
Modifier and TypeMethodDescriptionstatic RankFeatureQueryBuilderReturn a newRankFeatureQueryBuilderthat will score documents asS)where S is the indexed value of the static feature.static RankFeatureQueryBuilderReturn a newRankFeatureQueryBuilderthat will score documents asboost * Math.log(scalingFactor + S)where S is the value of the static feature.static RankFeatureQueryBuildersaturation(String fieldName) Same assaturation(String, float)but a reasonably good default pivot value is computed based on index statistics and is approximately equal to the geometric mean of all values that exist in the index.static RankFeatureQueryBuildersaturation(String fieldName, float pivot) Return a newRankFeatureQueryBuilderthat will score documents asboost * S / (S + pivot)where S is the value of the static feature.static RankFeatureQueryBuilderReturn a newRankFeatureQueryBuilderthat will score documents asboost * S^a / (S^a + pivot^a)where S is the value of the static feature.
-
Method Details
-
saturation
Return a newRankFeatureQueryBuilderthat will score documents asboost * S / (S + pivot)where S is the value of the static feature.- Parameters:
fieldName- field that stores featurespivot- feature value that would give a score contribution equal to weight/2, must be in (0, +Infinity)
-
saturation
Same assaturation(String, float)but a reasonably good default pivot value is computed based on index statistics and is approximately equal to the geometric mean of all values that exist in the index.- Parameters:
fieldName- field that stores features
-
log
Return a newRankFeatureQueryBuilderthat will score documents asboost * Math.log(scalingFactor + S)where S is the value of the static feature.- Parameters:
fieldName- field that stores featuresscalingFactor- scaling factor applied before taking the logarithm, must be in [1, +Infinity)
-
sigmoid
Return a newRankFeatureQueryBuilderthat will score documents asboost * S^a / (S^a + pivot^a)where S is the value of the static feature.- Parameters:
fieldName- field that stores featurespivot- feature value that would give a score contribution equal to weight/2, must be in (0, +Infinity)exp- exponent, higher values make the function grow slower before 'pivot' and faster after 'pivot', must be in (0, +Infinity)
-
linear
Return a newRankFeatureQueryBuilderthat will score documents asS)where S is the indexed value of the static feature.- Parameters:
fieldName- field that stores features
-