Module org.elasticsearch.server
Class TokenPruningConfig
java.lang.Object
org.elasticsearch.index.mapper.vectors.TokenPruningConfig
- All Implemented Interfaces:
Writeable,ToXContent,ToXContentObject
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.elasticsearch.xcontent.ToXContent
ToXContent.DelegatingMapParams, ToXContent.MapParams, ToXContent.ParamsNested classes/interfaces inherited from interface org.elasticsearch.common.io.stream.Writeable
Writeable.Reader<V>, Writeable.Writer<V> -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final floatstatic final floatstatic final floatstatic final ParseFieldstatic final ConstructingObjectParser<TokenPruningConfig, Void> static final Stringstatic final ParseFieldstatic final ParseFieldFields inherited from interface org.elasticsearch.xcontent.ToXContent
EMPTY, EMPTY_PARAMS -
Constructor Summary
ConstructorsConstructorDescriptionTokenPruningConfig(float tokensFreqRatioThreshold, float tokensWeightThreshold, boolean onlyScorePrunedTokens) -
Method Summary
Modifier and TypeMethodDescriptionbooleanstatic TokenPruningConfigfromXContent(XContentParser parser) floatReturns the frequency ratio threshold to apply on the query.floatReturns the weight threshold to apply on the query.inthashCode()booleanReturns whether the filtering process retains tokens identified as non-relevant based on the specified thresholds (ratio and weight).static TokenPruningConfigparseFromMap(Map<String, Object> pruningConfigMap) toXContent(XContentBuilder builder, ToXContent.Params params) voidwriteTo(StreamOutput out) Write this into the StreamOutput.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.elasticsearch.xcontent.ToXContentObject
isFragment
-
Field Details
-
PRUNING_CONFIG_FIELD
- See Also:
-
TOKENS_FREQ_RATIO_THRESHOLD
-
TOKENS_WEIGHT_THRESHOLD
-
ONLY_SCORE_PRUNED_TOKENS_FIELD
-
DEFAULT_TOKENS_FREQ_RATIO_THRESHOLD
public static final float DEFAULT_TOKENS_FREQ_RATIO_THRESHOLD- See Also:
-
MAX_TOKENS_FREQ_RATIO_THRESHOLD
public static final float MAX_TOKENS_FREQ_RATIO_THRESHOLD- See Also:
-
DEFAULT_TOKENS_WEIGHT_THRESHOLD
public static final float DEFAULT_TOKENS_WEIGHT_THRESHOLD- See Also:
-
PARSER
-
-
Constructor Details
-
TokenPruningConfig
public TokenPruningConfig() -
TokenPruningConfig
public TokenPruningConfig(float tokensFreqRatioThreshold, float tokensWeightThreshold, boolean onlyScorePrunedTokens) -
TokenPruningConfig
- Throws:
IOException
-
-
Method Details
-
writeTo
Description copied from interface:WriteableWrite this into the StreamOutput.- Specified by:
writeToin interfaceWriteable- Throws:
IOException
-
getTokensFreqRatioThreshold
public float getTokensFreqRatioThreshold()Returns the frequency ratio threshold to apply on the query. Tokens whose frequency is more than ratio_threshold times the average frequency of all tokens in the specified field are considered outliers and may be subject to removal from the query. -
getTokensWeightThreshold
public float getTokensWeightThreshold()Returns the weight threshold to apply on the query. Tokens whose weight is more than (weightThreshold * best_weight) of the highest weight in the query are not considered outliers, even if their frequency exceeds the specified ratio_threshold. This threshold ensures that important tokens, as indicated by their weight, are retained in the query. -
isOnlyScorePrunedTokens
public boolean isOnlyScorePrunedTokens()Returns whether the filtering process retains tokens identified as non-relevant based on the specified thresholds (ratio and weight). Whentrue, only non-relevant tokens are considered for matching and scoring documents. Enabling this option is valuable for re-scoring top hits retrieved from anotherQueryBuilderwith active thresholds. -
equals
-
hashCode
public int hashCode() -
toXContent
public XContentBuilder toXContent(XContentBuilder builder, ToXContent.Params params) throws IOException - Specified by:
toXContentin interfaceToXContent- Throws:
IOException
-
fromXContent
- Throws:
IOException
-
parseFromMap
-