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>
@JsonpDeserializable
public class SparseVectorQuery
extends QueryBase
implements TaggedUnion<SparseVectorQuery.Kind,Object>, QueryVariant, JsonpSerializable
- See Also:
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from class co.elastic.clients.elasticsearch._types.query_dsl.QueryBase
QueryBase.AbstractBuilder<BuilderT extends QueryBase.AbstractBuilder<BuilderT>> -
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionfinal Object_get()final SparseVectorQuery.Kind_kind()Get the of the kind of variant held by this object.Query variant kind.final Stringfield()Required - The name of the field that contains the token-weight pairs to be searched against.Get theinference_idvariant value.booleanIs this variant instance of kindinference_id?booleanIs this variant instance of kindquery_vector?static SparseVectorQueryfinal Booleanprune()Whether to perform pruning, omitting the non-significant tokens from the query to improve query performance.final TokenPruningConfigOptional pruning configuration.final Stringquery()The query text you want to use for search.Get thequery_vectorvariant value.voidserialize(jakarta.json.stream.JsonGenerator generator, JsonpMapper mapper) Serialize this object to JSON.protected static voidtoString()Methods inherited from class co.elastic.clients.elasticsearch._types.query_dsl.QueryBase
boost, queryName, serializeInternal, setupQueryBaseDeserializerMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface co.elastic.clients.elasticsearch._types.query_dsl.QueryVariant
_toQuery
-
Field Details
-
_DESERIALIZER
-
-
Method Details
-
_queryKind
Query variant kind.- Specified by:
_queryKindin interfaceQueryVariant
-
_kind
Description copied from interface:TaggedUnionGet the of the kind of variant held by this object.- Specified by:
_kindin interfaceTaggedUnion<SparseVectorQuery.Kind,Object> - Returns:
- the variant kind
-
_get
- Specified by:
_getin interfaceTaggedUnion<SparseVectorQuery.Kind,Object>
-
of
public static SparseVectorQuery of(Function<SparseVectorQuery.Builder, ObjectBuilder<SparseVectorQuery>> fn) -
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
The query text you want to use for search. If inference_id is specified, query must also be specified.API name:
query -
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: falseAPI name:
prune -
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 kindquery_vector? -
queryVector
Get thequery_vectorvariant value.- Throws:
IllegalStateException- if the current variant is not of thequery_vectorkind.
-
isInferenceId
public boolean isInferenceId()Is this variant instance of kindinference_id? -
inferenceId
Get theinference_idvariant value.- Throws:
IllegalStateException- if the current variant is not of theinference_idkind.
-
serialize
Description copied from class:QueryBaseSerialize this object to JSON.- Specified by:
serializein interfaceJsonpSerializable- Overrides:
serializein classQueryBase
-
toString
-
setupSparseVectorQueryDeserializer
protected static void setupSparseVectorQueryDeserializer(ObjectDeserializer<SparseVectorQuery.Builder> op)
-