public class BulkRequestBuilder extends ActionRequestBuilder<BulkRequest,BulkResponse,BulkRequestBuilder>
IndexRequest
s and DeleteRequest
s and allows to executes
it in a single batch.action, client, request
Constructor and Description |
---|
BulkRequestBuilder(ElasticsearchClient client,
BulkAction action) |
Modifier and Type | Method and Description |
---|---|
BulkRequestBuilder |
add(byte[] data,
int from,
int length)
Adds a framed data in binary format
|
BulkRequestBuilder |
add(byte[] data,
int from,
int length,
java.lang.String defaultIndex,
java.lang.String defaultType)
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 |
setConsistencyLevel(WriteConsistencyLevel consistencyLevel)
Sets the consistency level.
|
BulkRequestBuilder |
setRefresh(boolean refresh)
Should a refresh be executed post this bulk operation causing the operations to
be searchable.
|
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.
|
beforeExecute, execute, execute, get, get, get, request
public 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) throws java.lang.Exception
java.lang.Exception
public BulkRequestBuilder add(byte[] data, int from, int length, @Nullable java.lang.String defaultIndex, @Nullable java.lang.String defaultType) throws java.lang.Exception
java.lang.Exception
public BulkRequestBuilder setConsistencyLevel(WriteConsistencyLevel consistencyLevel)
WriteConsistencyLevel.DEFAULT
.public BulkRequestBuilder setRefresh(boolean refresh)
public final BulkRequestBuilder setTimeout(TimeValue timeout)
public final BulkRequestBuilder setTimeout(java.lang.String timeout)
public int numberOfActions()