Class FunctionScore
- java.lang.Object
-
- org.opensearch.client.opensearch._types.query_dsl.FunctionScore
-
- All Implemented Interfaces:
JsonpSerializable,TaggedUnion<FunctionScore.Kind,java.lang.Object>
@JsonpDeserializable public class FunctionScore extends java.lang.Object implements TaggedUnion<FunctionScore.Kind,java.lang.Object>, JsonpSerializable
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classFunctionScore.Builderstatic classFunctionScore.KindFunctionScorevariant kinds.
-
Field Summary
Fields Modifier and Type Field Description static JsonpDeserializer<FunctionScore>_DESERIALIZER
-
Constructor Summary
Constructors Constructor Description FunctionScore(FunctionScoreVariant value)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Object_get()FunctionScore.Kind_kind()Get the of the kind of variant held by this object.DecayFunctionexp()Get theexpvariant value.FieldValueFactorScoreFunctionfieldValueFactor()Get thefield_value_factorvariant value.Queryfilter()API name:filterDecayFunctiongauss()Get thegaussvariant value.booleanisExp()Is this variant instance of kindexp?booleanisFieldValueFactor()Is this variant instance of kindfield_value_factor?booleanisGauss()Is this variant instance of kindgauss?booleanisLinear()Is this variant instance of kindlinear?booleanisRandomScore()Is this variant instance of kindrandom_score?booleanisScriptScore()Is this variant instance of kindscript_score?DecayFunctionlinear()Get thelinearvariant value.static FunctionScoreof(java.util.function.Function<FunctionScore.Builder,ObjectBuilder<FunctionScore>> fn)RandomScoreFunctionrandomScore()Get therandom_scorevariant value.ScriptScoreFunctionscriptScore()Get thescript_scorevariant value.voidserialize(jakarta.json.stream.JsonGenerator generator, JsonpMapper mapper)protected static voidsetupFunctionScoreDeserializer(ObjectDeserializer<FunctionScore.Builder> op)java.lang.Doubleweight()API name:weight
-
-
-
Field Detail
-
_DESERIALIZER
public static final JsonpDeserializer<FunctionScore> _DESERIALIZER
-
-
Constructor Detail
-
FunctionScore
public FunctionScore(FunctionScoreVariant value)
-
-
Method Detail
-
_kind
public final FunctionScore.Kind _kind()
Description copied from interface:TaggedUnionGet the of the kind of variant held by this object.- Specified by:
_kindin interfaceTaggedUnion<FunctionScore.Kind,java.lang.Object>- Returns:
- the variant kind
-
_get
public final java.lang.Object _get()
- Specified by:
_getin interfaceTaggedUnion<FunctionScore.Kind,java.lang.Object>
-
of
public static FunctionScore of(java.util.function.Function<FunctionScore.Builder,ObjectBuilder<FunctionScore>> fn)
-
filter
@Nullable public final Query filter()
API name:filter
-
weight
@Nullable public final java.lang.Double weight()
API name:weight
-
isExp
public boolean isExp()
Is this variant instance of kindexp?
-
exp
public DecayFunction exp()
Get theexpvariant value.- Throws:
java.lang.IllegalStateException- if the current variant is not of theexpkind.
-
isGauss
public boolean isGauss()
Is this variant instance of kindgauss?
-
gauss
public DecayFunction gauss()
Get thegaussvariant value.- Throws:
java.lang.IllegalStateException- if the current variant is not of thegausskind.
-
isLinear
public boolean isLinear()
Is this variant instance of kindlinear?
-
linear
public DecayFunction linear()
Get thelinearvariant value.- Throws:
java.lang.IllegalStateException- if the current variant is not of thelinearkind.
-
isFieldValueFactor
public boolean isFieldValueFactor()
Is this variant instance of kindfield_value_factor?
-
fieldValueFactor
public FieldValueFactorScoreFunction fieldValueFactor()
Get thefield_value_factorvariant value.- Throws:
java.lang.IllegalStateException- if the current variant is not of thefield_value_factorkind.
-
isRandomScore
public boolean isRandomScore()
Is this variant instance of kindrandom_score?
-
randomScore
public RandomScoreFunction randomScore()
Get therandom_scorevariant value.- Throws:
java.lang.IllegalStateException- if the current variant is not of therandom_scorekind.
-
isScriptScore
public boolean isScriptScore()
Is this variant instance of kindscript_score?
-
scriptScore
public ScriptScoreFunction scriptScore()
Get thescript_scorevariant value.- Throws:
java.lang.IllegalStateException- if the current variant is not of thescript_scorekind.
-
serialize
public void serialize(jakarta.json.stream.JsonGenerator generator, JsonpMapper mapper)- Specified by:
serializein interfaceJsonpSerializable
-
setupFunctionScoreDeserializer
protected static void setupFunctionScoreDeserializer(ObjectDeserializer<FunctionScore.Builder> op)
-
-