WriteRequestBuilder<BulkRequestBuilder>public class BulkRequestBuilder extends ActionRequestBuilder<BulkRequest,BulkResponse,BulkRequestBuilder> implements WriteRequestBuilder<BulkRequestBuilder>
IndexRequests and DeleteRequests and allows to executes
it in a single batch.action, client, request| Constructor | Description |
|---|---|
BulkRequestBuilder(ElasticsearchClient client,
BulkAction action) |
| Modifier and Type | Method | Description |
|---|---|---|
BulkRequestBuilder |
add(byte[] data,
int from,
int length,
java.lang.String defaultIndex,
java.lang.String defaultType,
XContentType xContentType) |
Adds a framed data in binary format
|
BulkRequestBuilder |
add(byte[] data,
int from,
int length,
XContentType xContentType) |
Adds a framed data in binary format
|
BulkRequestBuilder |
add(DeleteRequest request) |
Adds an
DeleteRequest to the list of actions to execute. |
BulkRequestBuilder |
add(DeleteRequestBuilder request) |
Adds an
DeleteRequest to the list of actions to execute. |
BulkRequestBuilder |
add(IndexRequest request) |
Adds an
IndexRequest to the list of actions to execute. |
BulkRequestBuilder |
add(IndexRequestBuilder request) |
Adds an
IndexRequest to the list of actions to execute. |
BulkRequestBuilder |
add(UpdateRequest request) |
Adds an
UpdateRequest to the list of actions to execute. |
BulkRequestBuilder |
add(UpdateRequestBuilder request) |
Adds an
UpdateRequest to the list of actions to execute. |
int |
numberOfActions() |
The number of actions currently in the bulk.
|
BulkRequestBuilder |
setTimeout(java.lang.String timeout) |
A timeout to wait if the index operation can't be performed immediately.
|
BulkRequestBuilder |
setTimeout(TimeValue timeout) |
A timeout to wait if the index operation can't be performed immediately.
|
BulkRequestBuilder |
setWaitForActiveShards(int waitForActiveShards) |
A shortcut for
setWaitForActiveShards(ActiveShardCount) where the numerical
shard count is passed in, instead of having to first call ActiveShardCount.from(int)
to get the ActiveShardCount. |
BulkRequestBuilder |
setWaitForActiveShards(ActiveShardCount waitForActiveShards) |
Sets the number of shard copies that must be active before proceeding with the write.
|
execute, execute, get, get, get, requestclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitrequest, setRefreshPolicy, setRefreshPolicypublic BulkRequestBuilder(ElasticsearchClient client, BulkAction action)
public BulkRequestBuilder add(IndexRequest request)
IndexRequest to the list of actions to execute. Follows the same behavior of IndexRequest
(for example, if no id is provided, one will be generated, or usage of the create flag).public BulkRequestBuilder add(IndexRequestBuilder request)
IndexRequest to the list of actions to execute. Follows the same behavior of IndexRequest
(for example, if no id is provided, one will be generated, or usage of the create flag).public BulkRequestBuilder add(DeleteRequest request)
DeleteRequest to the list of actions to execute.public BulkRequestBuilder add(DeleteRequestBuilder request)
DeleteRequest to the list of actions to execute.public BulkRequestBuilder add(UpdateRequest request)
UpdateRequest to the list of actions to execute.public BulkRequestBuilder add(UpdateRequestBuilder request)
UpdateRequest to the list of actions to execute.public BulkRequestBuilder add(byte[] data, int from, int length, XContentType xContentType) throws java.lang.Exception
java.lang.Exceptionpublic BulkRequestBuilder add(byte[] data, int from, int length, @Nullable java.lang.String defaultIndex, @Nullable java.lang.String defaultType, XContentType xContentType) throws java.lang.Exception
java.lang.Exceptionpublic BulkRequestBuilder setWaitForActiveShards(ActiveShardCount waitForActiveShards)
ReplicationRequest.waitForActiveShards(ActiveShardCount) for details.public BulkRequestBuilder setWaitForActiveShards(int waitForActiveShards)
setWaitForActiveShards(ActiveShardCount) where the numerical
shard count is passed in, instead of having to first call ActiveShardCount.from(int)
to get the ActiveShardCount.public final BulkRequestBuilder setTimeout(TimeValue timeout)
public final BulkRequestBuilder setTimeout(java.lang.String timeout)
public int numberOfActions()