Class AsyncSearch.Builder<TDocument>
java.lang.Object
co.elastic.clients.util.ObjectBuilderBase
co.elastic.clients.util.WithJsonObjectBuilderBase<AsyncSearch.Builder<TDocument>>
co.elastic.clients.elasticsearch.async_search.AsyncSearch.Builder<TDocument>
- All Implemented Interfaces:
WithJson<AsyncSearch.Builder<TDocument>>
,ObjectBuilder<AsyncSearch<TDocument>>
- Enclosing class:
- AsyncSearch<TDocument>
public static class AsyncSearch.Builder<TDocument>
extends WithJsonObjectBuilderBase<AsyncSearch.Builder<TDocument>>
implements ObjectBuilder<AsyncSearch<TDocument>>
Builder for
AsyncSearch
.-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionfinal AsyncSearch.Builder<TDocument>
aggregations
(String key, Aggregate value) Partial aggregations results, coming from the shards that have already completed the execution of the query.final AsyncSearch.Builder<TDocument>
Partial aggregations results, coming from the shards that have already completed the execution of the query.final AsyncSearch.Builder<TDocument>
aggregations
(Map<String, Aggregate> map) Partial aggregations results, coming from the shards that have already completed the execution of the query.build()
Builds aAsyncSearch
.final AsyncSearch.Builder<TDocument>
clusters
(ClusterStatistics value) API name:_clusters
final AsyncSearch.Builder<TDocument>
API name:_clusters
final AsyncSearch.Builder<TDocument>
API name:fields
final AsyncSearch.Builder<TDocument>
API name:fields
final AsyncSearch.Builder<TDocument>
hits
(HitsMetadata<TDocument> value) Required - API name:hits
final AsyncSearch.Builder<TDocument>
Required - API name:hits
final AsyncSearch.Builder<TDocument>
API name:max_score
final AsyncSearch.Builder<TDocument>
numReducePhases
(Long value) Indicates how many reductions of the results have been performed.final AsyncSearch.Builder<TDocument>
API name:pit_id
final AsyncSearch.Builder<TDocument>
API name:profile
final AsyncSearch.Builder<TDocument>
API name:profile
final AsyncSearch.Builder<TDocument>
API name:_scroll_id
protected AsyncSearch.Builder<TDocument>
self()
final AsyncSearch.Builder<TDocument>
shards
(ShardStatistics value) Required - Indicates how many shards have run the query.final AsyncSearch.Builder<TDocument>
Required - Indicates how many shards have run the query.final AsyncSearch.Builder<TDocument>
suggest
(String key, List<Suggestion<TDocument>> value) API name:suggest
final AsyncSearch.Builder<TDocument>
API name:suggest
final AsyncSearch.Builder<TDocument>
Serializer for TDocument.final AsyncSearch.Builder<TDocument>
terminatedEarly
(Boolean value) API name:terminated_early
final AsyncSearch.Builder<TDocument>
timedOut
(boolean value) Required - API name:timed_out
final AsyncSearch.Builder<TDocument>
took
(long value) Required - API name:took
Methods inherited from class co.elastic.clients.util.WithJsonObjectBuilderBase
withJson
Methods inherited from class co.elastic.clients.util.ObjectBuilderBase
_checkSingleUse, _listAdd, _listAddAll, _mapPut, _mapPutAll
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
aggregations
Partial aggregations results, coming from the shards that have already completed the execution of the query.API name:
aggregations
Adds all entries of
map
toaggregations
. -
aggregations
Partial aggregations results, coming from the shards that have already completed the execution of the query.API name:
aggregations
Adds an entry to
aggregations
. -
aggregations
public final AsyncSearch.Builder<TDocument> aggregations(String key, Function<Aggregate.Builder, ObjectBuilder<Aggregate>> fn) Partial aggregations results, coming from the shards that have already completed the execution of the query.API name:
aggregations
Adds an entry to
aggregations
using a builder lambda. -
clusters
API name:_clusters
-
clusters
public final AsyncSearch.Builder<TDocument> clusters(Function<ClusterStatistics.Builder, ObjectBuilder<ClusterStatistics>> fn) API name:_clusters
-
fields
API name:fields
Adds all entries of
map
tofields
. -
fields
API name:fields
Adds an entry to
fields
. -
hits
Required - API name:hits
-
hits
public final AsyncSearch.Builder<TDocument> hits(Function<HitsMetadata.Builder<TDocument>, ObjectBuilder<HitsMetadata<TDocument>>> fn) Required - API name:hits
-
maxScore
API name:max_score
-
numReducePhases
Indicates how many reductions of the results have been performed. If this number increases compared to the last retrieved results for a get asynch search request, you can expect additional results included in the search response.API name:
num_reduce_phases
-
profile
API name:profile
-
profile
public final AsyncSearch.Builder<TDocument> profile(Function<Profile.Builder, ObjectBuilder<Profile>> fn) API name:profile
-
pitId
API name:pit_id
-
scrollId
API name:_scroll_id
-
shards
Required - Indicates how many shards have run the query. Note that in order for shard results to be included in the search response, they need to be reduced first.API name:
_shards
-
shards
public final AsyncSearch.Builder<TDocument> shards(Function<ShardStatistics.Builder, ObjectBuilder<ShardStatistics>> fn) Required - Indicates how many shards have run the query. Note that in order for shard results to be included in the search response, they need to be reduced first.API name:
_shards
-
suggest
API name:suggest
Adds all entries of
map
tosuggest
. -
suggest
API name:suggest
Adds an entry to
suggest
. -
terminatedEarly
API name:terminated_early
-
timedOut
Required - API name:timed_out
-
took
Required - API name:took
-
tDocumentSerializer
public final AsyncSearch.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:
self
in classWithJsonObjectBuilderBase<AsyncSearch.Builder<TDocument>>
-
build
Builds aAsyncSearch
.- Specified by:
build
in interfaceObjectBuilder<TDocument>
- Throws:
NullPointerException
- if some of the required fields are null.
-