public class BulkRequestBuilder extends ActionRequestBuilder<BulkRequest,BulkResponse,BulkRequestBuilder>
IndexRequests and DeleteRequests 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,
String defaultIndex,
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(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, putHeader, requestpublic 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 Exception
Exceptionpublic BulkRequestBuilder add(byte[] data, int from, int length, @Nullable String defaultIndex, @Nullable String defaultType) throws Exception
Exceptionpublic BulkRequestBuilder setConsistencyLevel(WriteConsistencyLevel consistencyLevel)
WriteConsistencyLevel.DEFAULT.public BulkRequestBuilder setRefresh(boolean refresh)
public final BulkRequestBuilder setTimeout(TimeValue timeout)
public final BulkRequestBuilder setTimeout(String timeout)
public int numberOfActions()
Copyright © 2009–2017. All rights reserved.