Class FunctionScore
java.lang.Object
co.elastic.clients.elasticsearch._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
- See Also:
- API specification
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
FunctionScore.Builder
static class
FunctionScore.Kind
FunctionScore
variant kinds. -
Field Summary
Fields Modifier and Type Field Description static JsonpDeserializer<FunctionScore>
_DESERIALIZER
-
Constructor Summary
Constructors Constructor Description FunctionScore(FunctionScoreVariant value)
-
Method Summary
Modifier and Type Method Description java.lang.Object
_get()
FunctionScore.Kind
_kind()
Get the of the kind of variant held by this object.DecayFunction
exp()
Get theexp
variant value.FieldValueFactorScoreFunction
fieldValueFactor()
Get thefield_value_factor
variant value.Query
filter()
API name:filter
DecayFunction
gauss()
Get thegauss
variant value.boolean
isExp()
Is this variant instance of kindexp
?boolean
isFieldValueFactor()
Is this variant instance of kindfield_value_factor
?boolean
isGauss()
Is this variant instance of kindgauss
?boolean
isLinear()
Is this variant instance of kindlinear
?boolean
isRandomScore()
Is this variant instance of kindrandom_score
?boolean
isScriptScore()
Is this variant instance of kindscript_score
?DecayFunction
linear()
Get thelinear
variant value.static FunctionScore
of(java.util.function.Function<FunctionScore.Builder,ObjectBuilder<FunctionScore>> fn)
RandomScoreFunction
randomScore()
Get therandom_score
variant value.ScriptScoreFunction
scriptScore()
Get thescript_score
variant value.void
serialize(jakarta.json.stream.JsonGenerator generator, JsonpMapper mapper)
protected static void
setupFunctionScoreDeserializer(ObjectDeserializer<FunctionScore.Builder> op)
java.lang.Double
weight()
API name:weight
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Field Details
-
_DESERIALIZER
-
-
Constructor Details
-
FunctionScore
-
-
Method Details
-
_kind
Description copied from interface:TaggedUnion
Get the of the kind of variant held by this object.- Specified by:
_kind
in interfaceTaggedUnion<FunctionScore.Kind,java.lang.Object>
- Returns:
- the variant kind
-
_get
@Nullable public final java.lang.Object _get()- Specified by:
_get
in interfaceTaggedUnion<FunctionScore.Kind,java.lang.Object>
-
of
public static FunctionScore of(java.util.function.Function<FunctionScore.Builder,ObjectBuilder<FunctionScore>> fn) -
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
Get theexp
variant value.- Throws:
java.lang.IllegalStateException
- if the current variant is not of theexp
kind.
-
isGauss
public boolean isGauss()Is this variant instance of kindgauss
? -
gauss
Get thegauss
variant value.- Throws:
java.lang.IllegalStateException
- if the current variant is not of thegauss
kind.
-
isLinear
public boolean isLinear()Is this variant instance of kindlinear
? -
linear
Get thelinear
variant value.- Throws:
java.lang.IllegalStateException
- if the current variant is not of thelinear
kind.
-
isFieldValueFactor
public boolean isFieldValueFactor()Is this variant instance of kindfield_value_factor
? -
fieldValueFactor
Get thefield_value_factor
variant value.- Throws:
java.lang.IllegalStateException
- if the current variant is not of thefield_value_factor
kind.
-
isRandomScore
public boolean isRandomScore()Is this variant instance of kindrandom_score
? -
randomScore
Get therandom_score
variant value.- Throws:
java.lang.IllegalStateException
- if the current variant is not of therandom_score
kind.
-
isScriptScore
public boolean isScriptScore()Is this variant instance of kindscript_score
? -
scriptScore
Get thescript_score
variant value.- Throws:
java.lang.IllegalStateException
- if the current variant is not of thescript_score
kind.
-
serialize
- Specified by:
serialize
in interfaceJsonpSerializable
-
setupFunctionScoreDeserializer
-