Class SparseVectorQuery

java.lang.Object
co.elastic.clients.elasticsearch._types.query_dsl.QueryBase
co.elastic.clients.elasticsearch._types.query_dsl.SparseVectorQuery
All Implemented Interfaces:
QueryVariant, JsonpSerializable, TaggedUnion<SparseVectorQuery.Kind,Object>

See Also:
  • Field Details

  • Method Details

    • _queryKind

      public Query.Kind _queryKind()
      Query variant kind.
      Specified by:
      _queryKind in interface QueryVariant
    • _kind

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

      public final Object _get()
      Specified by:
      _get in interface TaggedUnion<SparseVectorQuery.Kind,Object>
    • of

    • field

      public final String field()
      Required - The name of the field that contains the token-weight pairs to be searched against. This field must be a mapped sparse_vector field.

      API name: field

    • query

      @Nullable public final String query()
      The query text you want to use for search. If inference_id is specified, query must also be specified.

      API name: query

    • prune

      @Nullable public final Boolean prune()
      Whether to perform pruning, omitting the non-significant tokens from the query to improve query performance. If prune is true but the pruning_config is not specified, pruning will occur but default values will be used. Default: false

      API name: prune

    • pruningConfig

      @Nullable public final TokenPruningConfig pruningConfig()
      Optional pruning configuration. If enabled, this will omit non-significant tokens from the query in order to improve query performance. This is only used if prune is set to true. If prune is set to true but pruning_config is not specified, default values will be used.

      API name: pruning_config

    • isQueryVector

      public boolean isQueryVector()
      Is this variant instance of kind query_vector?
    • queryVector

      public Map<String,Float> queryVector()
      Get the query_vector variant value.
      Throws:
      IllegalStateException - if the current variant is not of the query_vector kind.
    • isInferenceId

      public boolean isInferenceId()
      Is this variant instance of kind inference_id?
    • inferenceId

      public String inferenceId()
      Get the inference_id variant value.
      Throws:
      IllegalStateException - if the current variant is not of the inference_id kind.
    • serialize

      public void serialize(jakarta.json.stream.JsonGenerator generator, JsonpMapper mapper)
      Description copied from class: QueryBase
      Serialize this object to JSON.
      Specified by:
      serialize in interface JsonpSerializable
      Overrides:
      serialize in class QueryBase
    • toString

      public String toString()
      Overrides:
      toString in class QueryBase
    • setupSparseVectorQueryDeserializer

      protected static void setupSparseVectorQueryDeserializer(ObjectDeserializer<SparseVectorQuery.Builder> op)