Class BulkRequest.Builder<TSource>
java.lang.Object
co.elastic.clients.elasticsearch._core.BulkRequest.Builder<TSource>
- All Implemented Interfaces:
ObjectBuilder<BulkRequest<TSource>>
- Enclosing class:
- BulkRequest<TSource>
public static class BulkRequest.Builder<TSource> extends java.lang.Object implements ObjectBuilder<BulkRequest<TSource>>
Builder for
BulkRequest
.-
Constructor Summary
Constructors Constructor Description Builder()
-
Method Summary
Modifier and Type Method Description BulkRequest.Builder<TSource>
addDocument(TSource value)
Add a document tooperations(List)
, creating the list if needed.BulkRequest.Builder<TSource>
addOperation(Operation value)
Add an Operation tooperations(List)
, creating the list if needed.BulkRequest.Builder<TSource>
addOperation(java.util.function.Function<Operation.Builder,ObjectBuilder<Operation>> fn)
Add an Operation tooperations(List)
, creating the list if needed.BulkRequest.Builder<TSource>
addSourceExcludes(java.lang.String value)
Add a value tosourceExcludes(List)
, creating the list if needed.BulkRequest.Builder<TSource>
addSourceIncludes(java.lang.String value)
Add a value tosourceIncludes(List)
, creating the list if needed.BulkRequest<TSource>
build()
Builds aBulkRequest
.BulkRequest.Builder<TSource>
index(java.lang.String value)
Default index for items which don't provide oneBulkRequest.Builder<TSource>
operations(java.lang.Object... value)
Required - Request body.BulkRequest.Builder<TSource>
operations(java.util.List<java.lang.Object> value)
Required - Request body.BulkRequest.Builder<TSource>
pipeline(java.lang.String value)
The pipeline id to preprocess incoming documents withBulkRequest.Builder<TSource>
refresh(jakarta.json.JsonValue value)
Iftrue
then refresh 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
(the default) then do nothing with refreshes.BulkRequest.Builder<TSource>
requireAlias(java.lang.Boolean value)
Sets require_alias for all incoming documents.BulkRequest.Builder<TSource>
routing(java.lang.String value)
Specific routing valueBulkRequest.Builder<TSource>
source(jakarta.json.JsonValue 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.Builder<TSource>
sourceExcludes(java.lang.String... value)
Default list of fields to exclude from the returned _source field, can be overridden on each sub-requestBulkRequest.Builder<TSource>
sourceExcludes(java.util.List<java.lang.String> value)
Default list of fields to exclude from the returned _source field, can be overridden on each sub-requestBulkRequest.Builder<TSource>
sourceIncludes(java.lang.String... value)
Default list of fields to extract and return from the _source field, can be overridden on each sub-requestBulkRequest.Builder<TSource>
sourceIncludes(java.util.List<java.lang.String> value)
Default list of fields to extract and return from the _source field, can be overridden on each sub-requestBulkRequest.Builder<TSource>
timeout(java.lang.String value)
Explicit operation timeoutBulkRequest.Builder<TSource>
tSourceSerializer(JsonpSerializer<TSource> value)
Serializer for TSource.BulkRequest.Builder<TSource>
type(java.lang.String value)
Default document type for items which don't provide oneBulkRequest.Builder<TSource>
waitForActiveShards(jakarta.json.JsonValue value)
Sets the number of shard copies that must be active before proceeding with the bulk operation.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
index
Default index for items which don't provide oneAPI name:
index
-
type
Default document type for items which don't provide oneAPI name:
type
-
pipeline
The pipeline id to preprocess incoming documents withAPI name:
pipeline
-
refresh
Iftrue
then refresh 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
(the default) then do nothing with refreshes.API name:
refresh
-
routing
Specific routing valueAPI name:
routing
-
source
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 BulkRequest.Builder<TSource> sourceExcludes(@Nullable java.util.List<java.lang.String> value)Default list of fields to exclude from the returned _source field, can be overridden on each sub-requestAPI name:
_source_excludes
-
sourceExcludes
Default list of fields to exclude from the returned _source field, can be overridden on each sub-requestAPI name:
_source_excludes
-
addSourceExcludes
Add a value tosourceExcludes(List)
, creating the list if needed. -
sourceIncludes
public BulkRequest.Builder<TSource> sourceIncludes(@Nullable java.util.List<java.lang.String> value)Default list of fields to extract and return from the _source field, can be overridden on each sub-requestAPI name:
_source_includes
-
sourceIncludes
Default list of fields to extract and return from the _source field, can be overridden on each sub-requestAPI name:
_source_includes
-
addSourceIncludes
Add a value tosourceIncludes(List)
, creating the list if needed. -
timeout
Explicit operation timeoutAPI name:
timeout
-
waitForActiveShards
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 toall
for 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
-
requireAlias
Sets require_alias for all incoming documents. Defaults to unset (false)API name:
require_alias
-
operations
Required - Request body.API name:
_value_body
-
operations
Required - Request body.API name:
_value_body
-
addOperation
Add an Operation tooperations(List)
, creating the list if needed. -
addDocument
Add a document tooperations(List)
, creating the list if needed. -
addOperation
public BulkRequest.Builder<TSource> addOperation(java.util.function.Function<Operation.Builder,ObjectBuilder<Operation>> fn)Add an Operation tooperations(List)
, creating the list if needed. -
tSourceSerializer
Serializer for TSource. If not set, an attempt will be made to find a serializer from the JSON context. -
build
Builds aBulkRequest
.- Specified by:
build
in interfaceObjectBuilder<TSource>
- Throws:
java.lang.NullPointerException
- if some of the required fields are null.
-