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.BuilderincludeSourceOnError(Boolean value) True or false if to include the document source in the error message in case of parsing errors.final BulkRequest.BuilderThe name of the data stream, index, or index alias to perform bulk actions on.final BulkRequest.BuilderlistExecutedPipelines(Boolean value) Iftrue, the response will include the ingest pipelines that were run for each index or create.final BulkRequest.Builderoperations(BulkOperation value, BulkOperation... values) Required - Request body.final BulkRequest.Builderoperations(BulkOperationVariant value, BulkOperationVariant... values) Required - Request body.final BulkRequest.BuilderRequired - Request body.final BulkRequest.Builderoperations(List<BulkOperation> list) Required - Request body.final BulkRequest.BuilderThe pipeline identifier to use to preprocess incoming documents.final BulkRequest.BuilderIftrue, Elasticsearch refreshes the affected shards to make this operation visible to search.final BulkRequest.BuilderrequireAlias(Boolean value) Iftrue, the request's actions must target an index alias.final BulkRequest.BuilderrequireDataStream(Boolean value) Iftrue, the request's actions must target a data stream (existing or to be created).final BulkRequest.BuilderA custom value that is used to route operations to a specific shard.protected BulkRequest.Builderself()final BulkRequest.Buildersource(SourceConfigParam value) Indicates whether to return the_sourcefield (trueorfalse) or contains a list of fields to return.final BulkRequest.BuilderIndicates whether to return the_sourcefield (trueorfalse) or contains a list of fields to return.final BulkRequest.BuildersourceExcludes(String value, String... values) A comma-separated list of source fields to exclude from the response.final BulkRequest.BuildersourceExcludes(List<String> list) A comma-separated list of source fields to exclude from the response.final BulkRequest.BuildersourceIncludes(String value, String... values) A comma-separated list of source fields to include in the response.final BulkRequest.BuildersourceIncludes(List<String> list) A comma-separated list of source fields to include in the response.final BulkRequest.BuilderThe period each action waits for the following operations: automatic index creation, dynamic mapping updates, and waiting for active shards.final BulkRequest.BuilderThe period each action waits for the following operations: automatic index creation, dynamic mapping updates, and waiting for active shards.final BulkRequest.BuilderThe number of shard copies that must be active before proceeding with the operation.final BulkRequest.BuilderThe number of shard copies that must be active before proceeding with the operation.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
-
source
Indicates whether to return the_sourcefield (trueorfalse) 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_sourcefield (trueorfalse) 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_includesquery parameter. If the_sourceparameter isfalse, this parameter is ignored.API name:
_source_excludesAdds all elements of
listtosourceExcludes. -
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_includesquery parameter. If the_sourceparameter isfalse, this parameter is ignored.API name:
_source_excludesAdds 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_excludesquery parameter. If the_sourceparameter isfalse, this parameter is ignored.API name:
_source_includesAdds all elements of
listtosourceIncludes. -
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_excludesquery parameter. If the_sourceparameter isfalse, this parameter is ignored.API name:
_source_includesAdds 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_noneturns 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 toallor 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 toallor 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
listtooperations. -
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
operationsusing a builder lambda. -
self
- Specified by:
selfin classRequestBase.AbstractBuilder<BulkRequest.Builder>
-
build
Builds aBulkRequest.- Specified by:
buildin interfaceObjectBuilder<BulkRequest>- Throws:
NullPointerException- if some of the required fields are null.
-