Class KnnQuery
java.lang.Object
co.elastic.clients.elasticsearch._types.KnnQuery
- All Implemented Interfaces:
JsonpSerializable
- See Also:
-
Nested Class Summary
-
Field Summary
Modifier and TypeFieldDescriptionstatic final JsonpDeserializer<KnnQuery>
Json deserializer forKnnQuery
-
Method Summary
Modifier and TypeMethodDescriptionfinal Float
boost()
Boost value to apply to kNN scoresfinal String
field()
Required - The name of the vector field to search againstfilter()
Filters for the kNN search queryfinal long
k()
Required - The final number of nearest neighbors to return as top hitsfinal long
Required - The number of nearest neighbor candidates to consider per shardstatic KnnQuery
The query vectorfinal QueryVectorBuilder
The query vector builder.void
serialize
(jakarta.json.stream.JsonGenerator generator, JsonpMapper mapper) Serialize this object to JSON.protected void
serializeInternal
(jakarta.json.stream.JsonGenerator generator, JsonpMapper mapper) protected static void
toString()
-
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:
serialize
in interfaceJsonpSerializable
-
serializeInternal
-
toString
-
setupKnnQueryDeserializer
-