Class BulkRequest.Builder
- java.lang.Object
-
- org.opensearch.client.util.ObjectBuilderBase
-
- org.opensearch.client.opensearch.core.BulkRequest.Builder
-
- All Implemented Interfaces:
ObjectBuilder<BulkRequest>
- Enclosing class:
- BulkRequest
public static class BulkRequest.Builder extends ObjectBuilderBase implements ObjectBuilder<BulkRequest>
Builder forBulkRequest.
-
-
Constructor Summary
Constructors Constructor Description Builder()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description BulkRequestbuild()Builds aBulkRequest.BulkRequest.Builderindex(java.lang.String value)Default index for items which don't provide oneBulkRequest.Builderoperations(java.util.function.Function<BulkOperation.Builder,ObjectBuilder<BulkOperation>> fn)Required - Request body.BulkRequest.Builderoperations(java.util.List<BulkOperation> list)Required - Request body.BulkRequest.Builderoperations(BulkOperation value, BulkOperation... values)Required - Request body.BulkRequest.Builderpipeline(java.lang.String value)The pipeline id to preprocess incoming documents withBulkRequest.Builderrefresh(Refresh value)Iftruethen refresh the affected shards to make this operation visible to search, ifwait_forthen wait for a refresh to make this operation visible to search, iffalse(the default) then do nothing with refreshes.BulkRequest.BuilderrequireAlias(java.lang.Boolean value)Sets require_alias for all incoming documents.BulkRequest.Builderrouting(java.lang.String value)Specific routing valueBulkRequest.Buildersource(java.util.function.Function<SourceConfigParam.Builder,ObjectBuilder<SourceConfigParam>> fn)True or false to return the _source field or not, or default list of fields to return, can be overridden on each sub-requestBulkRequest.Buildersource(SourceConfigParam value)True or false to return the _source field or not, or default list of fields to return, can be overridden on each sub-requestBulkRequest.BuildersourceExcludes(java.lang.String value, java.lang.String... values)Default list of fields to exclude from the returned _source field, can be overridden on each sub-requestBulkRequest.BuildersourceExcludes(java.util.List<java.lang.String> list)Default list of fields to exclude from the returned _source field, can be overridden on each sub-requestBulkRequest.BuildersourceIncludes(java.lang.String value, java.lang.String... values)Default list of fields to extract and return from the _source field, can be overridden on each sub-requestBulkRequest.BuildersourceIncludes(java.util.List<java.lang.String> list)Default list of fields to extract and return from the _source field, can be overridden on each sub-requestBulkRequest.Buildertimeout(java.util.function.Function<Time.Builder,ObjectBuilder<Time>> fn)Explicit operation timeoutBulkRequest.Buildertimeout(Time value)Explicit operation timeoutBulkRequest.BuilderwaitForActiveShards(java.util.function.Function<WaitForActiveShards.Builder,ObjectBuilder<WaitForActiveShards>> fn)Sets the number of shard copies that must be active before proceeding with the bulk operation.BulkRequest.BuilderwaitForActiveShards(WaitForActiveShards value)Sets the number of shard copies that must be active before proceeding with the bulk operation.-
Methods inherited from class org.opensearch.client.util.ObjectBuilderBase
_checkSingleUse, _listAdd, _listAddAll, _mapPut, _mapPutAll
-
-
-
-
Method Detail
-
source
public final BulkRequest.Builder source(@Nullable SourceConfigParam value)
True or false to return the _source field or not, or default list of fields to return, can be overridden on each sub-requestAPI name:
_source
-
source
public final BulkRequest.Builder source(java.util.function.Function<SourceConfigParam.Builder,ObjectBuilder<SourceConfigParam>> fn)
True or false to return the _source field or not, or default list of fields to return, can be overridden on each sub-requestAPI name:
_source
-
sourceExcludes
public final BulkRequest.Builder sourceExcludes(java.util.List<java.lang.String> list)
Default list of fields to exclude from the returned _source field, can be overridden on each sub-requestAPI name:
_source_excludesAdds all elements of
listtosourceExcludes.
-
sourceExcludes
public final BulkRequest.Builder sourceExcludes(java.lang.String value, java.lang.String... values)
Default list of fields to exclude from the returned _source field, can be overridden on each sub-requestAPI name:
_source_excludesAdds one or more values to
sourceExcludes.
-
sourceIncludes
public final BulkRequest.Builder sourceIncludes(java.util.List<java.lang.String> list)
Default list of fields to extract and return from the _source field, can be overridden on each sub-requestAPI name:
_source_includesAdds all elements of
listtosourceIncludes.
-
sourceIncludes
public final BulkRequest.Builder sourceIncludes(java.lang.String value, java.lang.String... values)
Default list of fields to extract and return from the _source field, can be overridden on each sub-requestAPI name:
_source_includesAdds one or more values to
sourceIncludes.
-
index
public final BulkRequest.Builder index(@Nullable java.lang.String value)
Default index for items which don't provide oneAPI name:
index
-
pipeline
public final BulkRequest.Builder pipeline(@Nullable java.lang.String value)
The pipeline id to preprocess incoming documents withAPI name:
pipeline
-
refresh
public final BulkRequest.Builder refresh(@Nullable Refresh value)
Iftruethen refresh the affected shards to make this operation visible to search, ifwait_forthen wait for a refresh to make this operation visible to search, iffalse(the default) then do nothing with refreshes.API name:
refresh
-
requireAlias
public final BulkRequest.Builder requireAlias(@Nullable java.lang.Boolean value)
Sets require_alias for all incoming documents. Defaults to unset (false)API name:
require_alias
-
routing
public final BulkRequest.Builder routing(@Nullable java.lang.String value)
Specific routing valueAPI name:
routing
-
timeout
public final BulkRequest.Builder timeout(@Nullable Time value)
Explicit operation timeoutAPI name:
timeout
-
timeout
public final BulkRequest.Builder timeout(java.util.function.Function<Time.Builder,ObjectBuilder<Time>> fn)
Explicit operation timeoutAPI name:
timeout
-
waitForActiveShards
public final BulkRequest.Builder waitForActiveShards(@Nullable WaitForActiveShards value)
Sets the number of shard copies that must be active before proceeding with the bulk operation. Defaults to 1, meaning the primary shard only. Set toallfor all shard copies, otherwise set to any non-negative value less than or equal to the total number of copies for the shard (number of replicas + 1)API name:
wait_for_active_shards
-
waitForActiveShards
public final BulkRequest.Builder waitForActiveShards(java.util.function.Function<WaitForActiveShards.Builder,ObjectBuilder<WaitForActiveShards>> fn)
Sets the number of shard copies that must be active before proceeding with the bulk operation. Defaults to 1, meaning the primary shard only. Set toallfor all shard copies, otherwise set to any non-negative value less than or equal to the total number of copies for the shard (number of replicas + 1)API name:
wait_for_active_shards
-
operations
public final BulkRequest.Builder operations(java.util.List<BulkOperation> list)
Required - Request body.API name:
_value_bodyAdds all elements of
listtooperations.
-
operations
public final BulkRequest.Builder operations(BulkOperation value, BulkOperation... values)
Required - Request body.API name:
_value_bodyAdds one or more values to
operations.
-
operations
public final BulkRequest.Builder operations(java.util.function.Function<BulkOperation.Builder,ObjectBuilder<BulkOperation>> fn)
Required - Request body.API name:
_value_bodyAdds a value to
operationsusing a builder lambda.
-
build
public BulkRequest build()
Builds aBulkRequest.- Specified by:
buildin interfaceObjectBuilder<BulkRequest>- Throws:
java.lang.NullPointerException- if some of the required fields are null.
-
-