Class KnnQuery
java.lang.Object
co.elastic.clients.elasticsearch._types.query_dsl.QueryBase
co.elastic.clients.elasticsearch._types.KnnQuery
- All Implemented Interfaces:
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
FieldsModifier and TypeFieldDescriptionstatic final JsonpDeserializer<KnnQuery>Json deserializer forKnnQuery -
Method Summary
Modifier and TypeMethodDescriptionQuery variant kind.final Stringfield()Required - The name of the vector field to search againstfilter()Filters for the kNN search queryfinal Integerk()The final number of nearest neighbors to return as top hitsfinal IntegerThe number of nearest neighbor candidates to consider per shardstatic KnnQueryThe query vectorfinal QueryVectorBuilderThe query vector builder.protected voidserializeInternal(jakarta.json.stream.JsonGenerator generator, JsonpMapper mapper) protected static voidfinal FloatThe minimum similarity for a vector to be considered a matchMethods inherited from class co.elastic.clients.elasticsearch._types.query_dsl.QueryBase
boost, queryName, serialize, setupQueryBaseDeserializer, toStringMethods 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
Json deserializer forKnnQuery
-
-
Method Details
-
of
-
_queryKind
Query variant kind.- Specified by:
_queryKindin interfaceQueryVariant
-
field
Required - The name of the vector field to search againstAPI name:
field -
queryVector
The query vectorAPI name:
query_vector -
queryVectorBuilder
The query vector builder. You must provide a query_vector_builder or query_vector, but not both.API name:
query_vector_builder -
numCandidates
The number of nearest neighbor candidates to consider per shardAPI name:
num_candidates -
k
The final number of nearest neighbors to return as top hitsAPI name:
k -
filter
Filters for the kNN search queryAPI name:
filter -
similarity
The minimum similarity for a vector to be considered a matchAPI name:
similarity -
serializeInternal
- Overrides:
serializeInternalin classQueryBase
-
setupKnnQueryDeserializer
-