Class KnnSearchResponse.Builder<TDocument>
java.lang.Object
co.elastic.clients.util.ObjectBuilderBase
co.elastic.clients.util.WithJsonObjectBuilderBase<KnnSearchResponse.Builder<TDocument>>
co.elastic.clients.elasticsearch.core.KnnSearchResponse.Builder<TDocument>
- All Implemented Interfaces:
WithJson<KnnSearchResponse.Builder<TDocument>>,ObjectBuilder<KnnSearchResponse<TDocument>>
- Enclosing class:
- KnnSearchResponse<TDocument>
public static class KnnSearchResponse.Builder<TDocument>
extends WithJsonObjectBuilderBase<KnnSearchResponse.Builder<TDocument>>
implements ObjectBuilder<KnnSearchResponse<TDocument>>
Builder for
KnnSearchResponse.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuild()Builds aKnnSearchResponse.The field values for the documents.The field values for the documents.hits(HitsMetadata<TDocument> value) Required - The returned documents and metadata.Required - The returned documents and metadata.The highest returned document score.protected KnnSearchResponse.Builder<TDocument>self()shards(ShardStatistics value) Required - A count of shards used for the request.Required - A count of shards used for the request.Serializer for TDocument.timedOut(boolean value) Required - If true, the request timed out before completion; returned results may be partial or empty.took(long value) Required - The milliseconds it took Elasticsearch to run the request.Methods inherited from class co.elastic.clients.util.WithJsonObjectBuilderBase
withJsonMethods inherited from class co.elastic.clients.util.ObjectBuilderBase
_checkSingleUse, _listAdd, _listAddAll, _mapPut, _mapPutAll
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
took
Required - The milliseconds it took Elasticsearch to run the request.API name:
took -
timedOut
Required - If true, the request timed out before completion; returned results may be partial or empty.API name:
timed_out -
shards
Required - A count of shards used for the request.API name:
_shards -
shards
public final KnnSearchResponse.Builder<TDocument> shards(Function<ShardStatistics.Builder, ObjectBuilder<ShardStatistics>> fn) Required - A count of shards used for the request.API name:
_shards -
hits
Required - The returned documents and metadata.API name:
hits -
hits
public final KnnSearchResponse.Builder<TDocument> hits(Function<HitsMetadata.Builder<TDocument>, ObjectBuilder<HitsMetadata<TDocument>>> fn) Required - The returned documents and metadata.API name:
hits -
fields
The field values for the documents. These fields must be specified in the request using thefieldsparameter.API name:
fieldsAdds all entries of
maptofields. -
fields
The field values for the documents. These fields must be specified in the request using thefieldsparameter.API name:
fieldsAdds an entry to
fields. -
maxScore
The highest returned document score. This value is null for requests that do not sort by score.API name:
max_score -
tDocumentSerializer
public final KnnSearchResponse.Builder<TDocument> tDocumentSerializer(@Nullable JsonpSerializer<TDocument> value) Serializer for TDocument. If not set, an attempt will be made to find a serializer from the JSON context. -
self
- Specified by:
selfin classWithJsonObjectBuilderBase<KnnSearchResponse.Builder<TDocument>>
-
build
Builds aKnnSearchResponse.- Specified by:
buildin interfaceObjectBuilder<TDocument>- Throws:
NullPointerException- if some of the required fields are null.
-