Class KnnSearchRequest
java.lang.Object
co.elastic.clients.elasticsearch._types.RequestBase
co.elastic.clients.elasticsearch.core.KnnSearchRequest
- All Implemented Interfaces:
JsonpSerializable
Performs a kNN search.
- See Also:
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from class co.elastic.clients.elasticsearch._types.RequestBase
RequestBase.AbstractBuilder<BuilderT extends RequestBase.AbstractBuilder<BuilderT>> -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final JsonpDeserializer<KnnSearchRequest>Json deserializer forKnnSearchRequeststatic final SimpleEndpoint<KnnSearchRequest,?> Endpoint "knn_search". -
Method Summary
Modifier and TypeMethodDescriptionstatic <TDocument>
Endpoint<KnnSearchRequest,KnnSearchResponse<TDocument>, ErrorResponse> createKnnSearchEndpoint(JsonpDeserializer<TDocument> tDocumentDeserializer) Create an "knn_search" endpoint.final List<FieldAndFormat>The request returns doc values for field names matching these patterns in the hits.fields property of the response.fields()The request returns values for field names matching these patterns in the hits.fields property of the response.filter()Query to filter the documents that can match.index()Required - A comma-separated list of index names to search; use_allor to perform the operation on all indicesfinal KnnSearchQueryknn()Required - kNN query to executestatic KnnSearchRequestfinal Stringrouting()A comma-separated list of specific routing valuesvoidserialize(jakarta.json.stream.JsonGenerator generator, JsonpMapper mapper) Serialize this object to JSON.protected voidserializeInternal(jakarta.json.stream.JsonGenerator generator, JsonpMapper mapper) protected static voidfinal SourceConfigsource()Indicates which source fields are returned for matching documents.List of stored fields to return as part of a hit.Methods inherited from class co.elastic.clients.elasticsearch._types.RequestBase
toString
-
Field Details
-
_DESERIALIZER
Json deserializer forKnnSearchRequest -
_ENDPOINT
Endpoint "knn_search".
-
-
Method Details
-
of
public static KnnSearchRequest of(Function<KnnSearchRequest.Builder, ObjectBuilder<KnnSearchRequest>> fn) -
source
Indicates which source fields are returned for matching documents. These fields are returned in the hits._source property of the search response.API name:
_source -
docvalueFields
The request returns doc values for field names matching these patterns in the hits.fields property of the response. Accepts wildcard (*) patterns.API name:
docvalue_fields -
fields
The request returns values for field names matching these patterns in the hits.fields property of the response. Accepts wildcard (*) patterns.API name:
fields -
filter
Query to filter the documents that can match. The kNN search will return the topkdocuments that also match this filter. The value can be a single query or a list of queries. Iffilterisn't provided, all documents are allowed to match.API name:
filter -
index
Required - A comma-separated list of index names to search; use_allor to perform the operation on all indicesAPI name:
index -
knn
Required - kNN query to executeAPI name:
knn -
routing
A comma-separated list of specific routing valuesAPI name:
routing -
storedFields
List of stored fields to return as part of a hit. If no fields are specified, no stored fields are included in the response. If this field is specified, the _source parameter defaults to false. You can pass _source: true to return both source fields and stored fields in the search response.API name:
stored_fields -
serialize
Serialize this object to JSON.- Specified by:
serializein interfaceJsonpSerializable
-
serializeInternal
-
setupKnnSearchRequestDeserializer
protected static void setupKnnSearchRequestDeserializer(ObjectDeserializer<KnnSearchRequest.Builder> op) -
createKnnSearchEndpoint
public static <TDocument> Endpoint<KnnSearchRequest,KnnSearchResponse<TDocument>, createKnnSearchEndpointErrorResponse> (JsonpDeserializer<TDocument> tDocumentDeserializer) Create an "knn_search" endpoint.
-