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
  • Field Details

  • Constructor Details

  • Method Details

    • _kind

      public final FunctionScore.Kind _kind()
      Description copied from interface: TaggedUnion
      Get the of the kind of variant held by this object.
      Specified by:
      _kind in interface TaggedUnion<FunctionScore.Kind,​java.lang.Object>
      Returns:
      the variant kind
    • _get

      public final java.lang.Object _get()
      Specified by:
      _get in interface TaggedUnion<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 kind exp?
    • exp

      public DecayFunction exp()
      Get the exp variant value.
      Throws:
      java.lang.IllegalStateException - if the current variant is not of the exp kind.
    • isGauss

      public boolean isGauss()
      Is this variant instance of kind gauss?
    • gauss

      public DecayFunction gauss()
      Get the gauss variant value.
      Throws:
      java.lang.IllegalStateException - if the current variant is not of the gauss kind.
    • isLinear

      public boolean isLinear()
      Is this variant instance of kind linear?
    • linear

      public DecayFunction linear()
      Get the linear variant value.
      Throws:
      java.lang.IllegalStateException - if the current variant is not of the linear kind.
    • isFieldValueFactor

      public boolean isFieldValueFactor()
      Is this variant instance of kind field_value_factor?
    • fieldValueFactor

      public FieldValueFactorScoreFunction fieldValueFactor()
      Get the field_value_factor variant value.
      Throws:
      java.lang.IllegalStateException - if the current variant is not of the field_value_factor kind.
    • isRandomScore

      public boolean isRandomScore()
      Is this variant instance of kind random_score?
    • randomScore

      public RandomScoreFunction randomScore()
      Get the random_score variant value.
      Throws:
      java.lang.IllegalStateException - if the current variant is not of the random_score kind.
    • isScriptScore

      public boolean isScriptScore()
      Is this variant instance of kind script_score?
    • scriptScore

      public ScriptScoreFunction scriptScore()
      Get the script_score variant value.
      Throws:
      java.lang.IllegalStateException - if the current variant is not of the script_score kind.
    • serialize

      public void serialize​(jakarta.json.stream.JsonGenerator generator, JsonpMapper mapper)
      Specified by:
      serialize in interface JsonpSerializable
    • setupFunctionScoreDeserializer

      protected static void setupFunctionScoreDeserializer​(ObjectDeserializer<FunctionScore.Builder> op)