Class KnnSearchResponse<TDocument>
java.lang.Object
co.elastic.clients.elasticsearch.core.KnnSearchResponse<TDocument>
- All Implemented Interfaces:
JsonpSerializable
@JsonpDeserializable public class KnnSearchResponse<TDocument> extends java.lang.Object implements JsonpSerializable
- See Also:
- API specification
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
KnnSearchResponse.Builder<TDocument>
Builder forKnnSearchResponse
. -
Field Summary
Fields Modifier and Type Field Description static JsonpDeserializer<KnnSearchResponse<java.lang.Object>>
_DESERIALIZER
Json deserializer forKnnSearchResponse
based on named deserializers provided by the callingJsonMapper
. -
Method Summary
Modifier and Type Method Description static <TDocument>
JsonpDeserializer<KnnSearchResponse<TDocument>>createKnnSearchResponseDeserializer(JsonpDeserializer<TDocument> tDocumentDeserializer)
Create a JSON deserializer for KnnSearchResponsejava.util.Map<java.lang.String,JsonData>
fields()
Contains field values for the documents.HitsMetadata<TDocument>
hits()
Required - Contains returned documents and metadata.java.lang.Double
maxScore()
Highest returned document score.static <TDocument>
KnnSearchResponse<TDocument>of(java.util.function.Function<KnnSearchResponse.Builder<TDocument>,ObjectBuilder<KnnSearchResponse<TDocument>>> fn)
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 <TDocument>
voidsetupKnnSearchResponseDeserializer(ObjectDeserializer<KnnSearchResponse.Builder<TDocument>> op, JsonpDeserializer<TDocument> tDocumentDeserializer)
ShardStatistics
shards()
Required - Contains a count of shards used for the request.boolean
timedOut()
Required - If true, the request timed out before completion; returned results may be partial or empty.long
took()
Required - Milliseconds it took Elasticsearch to execute the request.java.lang.String
toString()
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Field Details
-
_DESERIALIZER
Json deserializer forKnnSearchResponse
based on named deserializers provided by the callingJsonMapper
.
-
-
Method Details
-
of
public static <TDocument> KnnSearchResponse<TDocument> of(java.util.function.Function<KnnSearchResponse.Builder<TDocument>,ObjectBuilder<KnnSearchResponse<TDocument>>> fn) -
took
public final long took()Required - Milliseconds it took Elasticsearch to execute the request.API name:
took
-
timedOut
public final boolean timedOut()Required - If true, the request timed out before completion; returned results may be partial or empty.API name:
timed_out
-
shards
Required - Contains a count of shards used for the request.API name:
_shards
-
hits
Required - Contains returned documents and metadata.API name:
hits
-
fields
Contains field values for the documents. These fields must be specified in the request using thefields
parameter.API name:
fields
-
maxScore
@Nullable public final java.lang.Double maxScore()Highest returned document score. This value is null for requests that do not sort by score.API name:
max_score
-
serialize
Serialize this object to JSON.- Specified by:
serialize
in interfaceJsonpSerializable
-
serializeInternal
-
toString
public java.lang.String toString()- Overrides:
toString
in classjava.lang.Object
-
createKnnSearchResponseDeserializer
public static <TDocument> JsonpDeserializer<KnnSearchResponse<TDocument>> createKnnSearchResponseDeserializer(JsonpDeserializer<TDocument> tDocumentDeserializer)Create a JSON deserializer for KnnSearchResponse -
setupKnnSearchResponseDeserializer
protected static <TDocument> void setupKnnSearchResponseDeserializer(ObjectDeserializer<KnnSearchResponse.Builder<TDocument>> op, JsonpDeserializer<TDocument> tDocumentDeserializer)
-