Class BulkRequest.Builder
- All Implemented Interfaces:
WithJson<BulkRequest.Builder>
,ObjectBuilder<BulkRequest>
- Enclosing class:
- BulkRequest
BulkRequest
.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuild()
Builds aBulkRequest
.final BulkRequest.Builder
includeSourceOnError
(Boolean value) True or false if to include the document source in the error message in case of parsing errors.final BulkRequest.Builder
The name of the data stream, index, or index alias to perform bulk actions on.final BulkRequest.Builder
listExecutedPipelines
(Boolean value) Iftrue
, the response will include the ingest pipelines that were run for each index or create.final BulkRequest.Builder
operations
(BulkOperation value, BulkOperation... values) Required - Request body.final BulkRequest.Builder
operations
(BulkOperationVariant value, BulkOperationVariant... values) Required - Request body.final BulkRequest.Builder
Required - Request body.final BulkRequest.Builder
operations
(List<BulkOperation> list) Required - Request body.final BulkRequest.Builder
The pipeline identifier to use to preprocess incoming documents.final BulkRequest.Builder
Iftrue
, Elasticsearch refreshes the affected shards to make this operation visible to search.final BulkRequest.Builder
requireAlias
(Boolean value) Iftrue
, the request's actions must target an index alias.final BulkRequest.Builder
requireDataStream
(Boolean value) Iftrue
, the request's actions must target a data stream (existing or to be created).final BulkRequest.Builder
A custom value that is used to route operations to a specific shard.protected BulkRequest.Builder
self()
final BulkRequest.Builder
source
(SourceConfigParam value) Indicates whether to return the_source
field (true
orfalse
) or contains a list of fields to return.final BulkRequest.Builder
Indicates whether to return the_source
field (true
orfalse
) or contains 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
The period each action waits for the following operations: automatic index creation, dynamic mapping updates, and waiting for active shards.final BulkRequest.Builder
The period each action waits for the following operations: automatic index creation, dynamic mapping updates, and 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
Indicates whether to return the_source
field (true
orfalse
) or contains a list of fields to return.API name:
_source
-
source
public final BulkRequest.Builder source(Function<SourceConfigParam.Builder, ObjectBuilder<SourceConfigParam>> fn) Indicates whether to return the_source
field (true
orfalse
) or contains a list of fields to return.API name:
_source
-
sourceExcludes
A comma-separated list of source fields to exclude from the response. You can also use this parameter to exclude fields from the subset specified in_source_includes
query parameter. If the_source
parameter isfalse
, this parameter is ignored.API name:
_source_excludes
Adds all elements of
list
tosourceExcludes
. -
sourceExcludes
A comma-separated list of source fields to exclude from the response. You can also use this parameter to exclude fields from the subset specified in_source_includes
query parameter. If the_source
parameter isfalse
, this parameter is ignored.API name:
_source_excludes
Adds one or more values to
sourceExcludes
. -
sourceIncludes
A comma-separated list of source fields to include in the response. If this parameter is specified, only these source fields are returned. You can exclude fields from this subset using the_source_excludes
query parameter. If the_source
parameter isfalse
, this parameter is ignored.API name:
_source_includes
Adds all elements of
list
tosourceIncludes
. -
sourceIncludes
A comma-separated list of source fields to include in the response. If this parameter is specified, only these source fields are returned. You can exclude fields from this subset using the_source_excludes
query parameter. If the_source
parameter isfalse
, this parameter is ignored.API name:
_source_includes
Adds one or more values to
sourceIncludes
. -
includeSourceOnError
True or false if to include the document source in the error message in case of parsing errors.API name:
include_source_on_error
-
index
The name of the data stream, index, or index alias to perform bulk actions on.API name:
index
-
listExecutedPipelines
Iftrue
, the response will include the ingest pipelines that were run for each index or create.API name:
list_executed_pipelines
-
pipeline
The pipeline identifier to use to preprocess incoming documents. If the index has a default ingest pipeline specified, setting the value to_none
turns off 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
, 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
-
requireDataStream
Iftrue
, the request's actions must target a data stream (existing or to be created).API name:
require_data_stream
-
routing
A custom value that is used to route operations to a specific shard.API name:
routing
-
timeout
The period each action waits for the following operations: automatic index creation, dynamic mapping updates, and waiting for active shards. The default is1m
(one minute), which guarantees Elasticsearch waits for at least the timeout before failing. The actual wait time could be longer, particularly when multiple waits occur.API name:
timeout
-
timeout
The period each action waits for the following operations: automatic index creation, dynamic mapping updates, and waiting for active shards. The default is1m
(one minute), which guarantees Elasticsearch waits for at least the timeout before failing. The actual wait time could be longer, particularly when multiple waits occur.API name:
timeout
-
waitForActiveShards
The number of shard copies that must be active before proceeding with the operation. Set toall
or any positive integer up to the total number of shards in the index (number_of_replicas+1
). The default is1
, which waits for each primary shard to be active.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 toall
or any positive integer up to the total number of shards in the index (number_of_replicas+1
). The default is1
, which waits for each primary shard to be active.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(BulkOperationVariant value, BulkOperationVariant... values) 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.
-