Class BulkRequest<TSource>
java.lang.Object
co.elastic.clients.elasticsearch._types.RequestBase
co.elastic.clients.elasticsearch._core.BulkRequest<TSource>
- All Implemented Interfaces:
ElasticsearchCommonRequest
,JsonpSerializable
,NdJsonpSerializable<java.lang.Object>
,java.lang.Iterable<java.lang.Object>
public final class BulkRequest<TSource> extends RequestBase implements NdJsonpSerializable<java.lang.Object>, JsonpSerializable
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
BulkRequest.Builder<TSource>
Builder forBulkRequest
.Nested classes/interfaces inherited from class co.elastic.clients.elasticsearch._types.RequestBase
RequestBase.AbstractBuilder<BuilderT extends RequestBase.AbstractBuilder<BuilderT>>
-
Field Summary
Fields Modifier and Type Field Description static Endpoint<BulkRequest<?>,BulkResponse,ElasticsearchError>
ENDPOINT
Endpoint "bulk
". -
Constructor Summary
Constructors Constructor Description BulkRequest(BulkRequest.Builder<TSource> builder)
BulkRequest(java.util.function.Function<BulkRequest.Builder<TSource>,BulkRequest.Builder<TSource>> fn)
-
Method Summary
Modifier and Type Method Description java.lang.String
index()
Default index for items which don't provide onejava.util.Iterator<java.lang.Object>
iterator()
java.util.List<java.lang.Object>
operations()
Request body.java.lang.String
pipeline()
The pipeline id to preprocess incoming documents withjakarta.json.JsonValue
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.java.lang.Boolean
requireAlias()
Sets require_alias for all incoming documents.java.lang.String
routing()
Specific routing valuevoid
serialize(jakarta.json.stream.JsonGenerator generator, JsonpMapper mapper)
Serialize this value to JSON.jakarta.json.JsonValue
source()
True or false to return the _source field or not, or default list of fields to return, can be overridden on each sub-requestjava.util.List<java.lang.String>
sourceExcludes()
Default list of fields to exclude from the returned _source field, can be overridden on each sub-requestjava.util.List<java.lang.String>
sourceIncludes()
Default list of fields to extract and return from the _source field, can be overridden on each sub-requestjava.lang.String
timeout()
Explicit operation timeoutjava.lang.String
type()
Default document type for items which don't provide onejakarta.json.JsonValue
waitForActiveShards()
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
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
Field Details
-
ENDPOINT
Endpoint "bulk
".
-
-
Constructor Details
-
BulkRequest
-
BulkRequest
public BulkRequest(java.util.function.Function<BulkRequest.Builder<TSource>,BulkRequest.Builder<TSource>> fn)
-
-
Method Details
-
index
@Nullable public java.lang.String index()Default index for items which don't provide oneAPI name:
index
-
type
@Nullable public java.lang.String type()Default document type for items which don't provide oneAPI name:
type
-
pipeline
@Nullable public java.lang.String pipeline()The pipeline id to preprocess incoming documents withAPI name:
pipeline
-
refresh
@Nullable public jakarta.json.JsonValue 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
@Nullable public java.lang.String routing()Specific routing valueAPI name:
routing
-
source
@Nullable public jakarta.json.JsonValue 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
@Nullable public java.util.List<java.lang.String> sourceExcludes()Default list of fields to exclude from the returned _source field, can be overridden on each sub-requestAPI name:
_source_excludes
-
sourceIncludes
@Nullable public java.util.List<java.lang.String> sourceIncludes()Default list of fields to extract and return from the _source field, can be overridden on each sub-requestAPI name:
_source_includes
-
timeout
@Nullable public java.lang.String timeout()Explicit operation timeoutAPI name:
timeout
-
waitForActiveShards
@Nullable public jakarta.json.JsonValue 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
@Nullable public java.lang.Boolean requireAlias()Sets require_alias for all incoming documents. Defaults to unset (false)API name:
require_alias
-
operations
public java.util.List<java.lang.Object> operations()Request body.API name:
_value_body
-
iterator
public java.util.Iterator<java.lang.Object> iterator()- Specified by:
iterator
in interfacejava.lang.Iterable<TSource>
-
serialize
Serialize this value to JSON.- Specified by:
serialize
in interfaceJsonpSerializable
-