Class BulkRequest.Builder
java.lang.Object
co.elastic.clients.util.ObjectBuilderBase
co.elastic.clients.util.WithJsonObjectBuilderBase<BuilderT>
co.elastic.clients.elasticsearch._types.RequestBase.AbstractBuilder<BulkRequest.Builder>
co.elastic.clients.elasticsearch.core.BulkRequest.Builder
- All Implemented Interfaces:
WithJson<BulkRequest.Builder>
,ObjectBuilder<BulkRequest>
- Enclosing class:
- BulkRequest
public static class BulkRequest.Builder
extends RequestBase.AbstractBuilder<BulkRequest.Builder>
implements ObjectBuilder<BulkRequest>
Builder for
BulkRequest
.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuild()
Builds aBulkRequest
.final BulkRequest.Builder
Name of the data stream, index, or index alias to perform bulk actions on.final BulkRequest.Builder
operations
(BulkOperation value, BulkOperation... values) Required - Request body.final BulkRequest.Builder
Required - Request body.final BulkRequest.Builder
operations
(List<BulkOperation> list) Required - Request body.final BulkRequest.Builder
ID of the pipeline to use to preprocess incoming documents.final BulkRequest.Builder
Iftrue
, Elasticsearch refreshes the affected shards to make this operation visible to search, ifwait_for
then wait for a refresh to make this operation visible to search, iffalse
do nothing with refreshes.final BulkRequest.Builder
requireAlias
(Boolean value) Iftrue
, the request’s actions must target an index alias.final BulkRequest.Builder
Custom value used to route operations to a specific shard.protected BulkRequest.Builder
self()
final BulkRequest.Builder
source
(SourceConfigParam value) true
orfalse
to return the_source
field or not, or a list of fields to return.final BulkRequest.Builder
true
orfalse
to return the_source
field or not, or a list of fields to return.final BulkRequest.Builder
sourceExcludes
(String value, String... values) A comma-separated list of source fields to exclude from the response.final BulkRequest.Builder
sourceExcludes
(List<String> list) A comma-separated list of source fields to exclude from the response.final BulkRequest.Builder
sourceIncludes
(String value, String... values) A comma-separated list of source fields to include in the response.final BulkRequest.Builder
sourceIncludes
(List<String> list) A comma-separated list of source fields to include in the response.final BulkRequest.Builder
Period each action waits for the following operations: automatic index creation, dynamic mapping updates, waiting for active shards.final BulkRequest.Builder
Period each action waits for the following operations: automatic index creation, dynamic mapping updates, waiting for active shards.final BulkRequest.Builder
The number of shard copies that must be active before proceeding with the operation.final BulkRequest.Builder
The number of shard copies that must be active before proceeding with the operation.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
-
source
true
orfalse
to return the_source
field or not, or a list of fields to return.API name:
_source
-
source
public final BulkRequest.Builder source(Function<SourceConfigParam.Builder, ObjectBuilder<SourceConfigParam>> fn) true
orfalse
to return the_source
field or not, or a list of fields to return.API name:
_source
-
sourceExcludes
A comma-separated list of source fields to exclude from the response.API name:
_source_excludes
Adds all elements of
list
tosourceExcludes
. -
sourceExcludes
A comma-separated list of source fields to exclude from the response.API name:
_source_excludes
Adds one or more values to
sourceExcludes
. -
sourceIncludes
A comma-separated list of source fields to include in the response.API name:
_source_includes
Adds all elements of
list
tosourceIncludes
. -
sourceIncludes
A comma-separated list of source fields to include in the response.API name:
_source_includes
Adds one or more values to
sourceIncludes
. -
index
Name of the data stream, index, or index alias to perform bulk actions on.API name:
index
-
pipeline
ID of the pipeline to use to preprocess incoming documents. If the index has a default ingest pipeline specified, then setting the value to_none
disables the default ingest pipeline for this request. If a final pipeline is configured it will always run, regardless of the value of this parameter.API name:
pipeline
-
refresh
Iftrue
, Elasticsearch refreshes the affected shards to make this operation visible to search, ifwait_for
then wait for a refresh to make this operation visible to search, iffalse
do nothing with refreshes. Valid values:true
,false
,wait_for
.API name:
refresh
-
requireAlias
Iftrue
, the request’s actions must target an index alias.API name:
require_alias
-
routing
Custom value used to route operations to a specific shard.API name:
routing
-
timeout
Period each action waits for the following operations: automatic index creation, dynamic mapping updates, waiting for active shards.API name:
timeout
-
timeout
Period each action waits for the following operations: automatic index creation, dynamic mapping updates, waiting for active shards.API name:
timeout
-
waitForActiveShards
The number of shard copies that must be active before proceeding with the operation. Set to all or any positive integer up to the total number of shards in the index (number_of_replicas+1
).API name:
wait_for_active_shards
-
waitForActiveShards
public final BulkRequest.Builder waitForActiveShards(Function<WaitForActiveShards.Builder, ObjectBuilder<WaitForActiveShards>> fn) The number of shard copies that must be active before proceeding with the operation. Set to all or any positive integer up to the total number of shards in the index (number_of_replicas+1
).API name:
wait_for_active_shards
-
operations
Required - Request body.Adds all elements of
list
tooperations
. -
operations
Required - Request body.Adds one or more values to
operations
. -
operations
public final BulkRequest.Builder operations(Function<BulkOperation.Builder, ObjectBuilder<BulkOperation>> fn) Required - Request body.Adds a value to
operations
using a builder lambda. -
self
- Specified by:
self
in classRequestBase.AbstractBuilder<BulkRequest.Builder>
-
build
Builds aBulkRequest
.- Specified by:
build
in interfaceObjectBuilder<BulkRequest>
- Throws:
NullPointerException
- if some of the required fields are null.
-