Class KnnQuery
java.lang.Object
co.elastic.clients.elasticsearch._types.KnnQuery
- All Implemented Interfaces:
JsonpSerializable
- See Also:
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final JsonpDeserializer<KnnQuery>Json deserializer forKnnQuery -
Method Summary
Modifier and TypeMethodDescriptionfinal Floatboost()Boost value to apply to kNN scoresfinal Stringfield()Required - The name of the vector field to search againstfilter()Filters for the kNN search queryfinal longk()Required - The final number of nearest neighbors to return as top hitsfinal longRequired - The number of nearest neighbor candidates to consider per shardstatic KnnQueryThe query vectorfinal QueryVectorBuilderThe query vector builder.voidserialize(jakarta.json.stream.JsonGenerator generator, JsonpMapper mapper) Serialize this object to JSON.protected voidserializeInternal(jakarta.json.stream.JsonGenerator generator, JsonpMapper mapper) protected static voidtoString()
-
Field Details
-
_DESERIALIZER
Json deserializer forKnnQuery
-
-
Method Details
-
of
-
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 -
k
public final long k()Required - The final number of nearest neighbors to return as top hitsAPI name:
k -
numCandidates
public final long numCandidates()Required - The number of nearest neighbor candidates to consider per shardAPI name:
num_candidates -
boost
Boost value to apply to kNN scoresAPI name:
boost -
filter
Filters for the kNN search queryAPI name:
filter -
serialize
Serialize this object to JSON.- Specified by:
serializein interfaceJsonpSerializable
-
serializeInternal
-
toString
-
setupKnnQueryDeserializer
-