pub struct Bulk<'a, 'b, B> { /* private fields */ }
Expand description
Builder for the Bulk API
Allows to perform multiple index/update/delete operations in a single request.
Implementations§
Source§impl<'a, 'b, B> Bulk<'a, 'b, B>where
B: Body,
impl<'a, 'b, B> Bulk<'a, 'b, B>where
B: Body,
Sourcepub fn new(transport: &'a Transport, parts: BulkParts<'b>) -> Self
pub fn new(transport: &'a Transport, parts: BulkParts<'b>) -> Self
Creates a new instance of Bulk with the specified API parts
Sourcepub fn _source(self, _source: &'b [&'b str]) -> Self
pub fn _source(self, _source: &'b [&'b str]) -> Self
True or false to return the _source field or not, or default list of fields to return, can be overridden on each sub-request
Sourcepub fn _source_excludes(self, _source_excludes: &'b [&'b str]) -> Self
pub fn _source_excludes(self, _source_excludes: &'b [&'b str]) -> Self
Default list of fields to exclude from the returned _source field, can be overridden on each sub-request
Sourcepub fn _source_includes(self, _source_includes: &'b [&'b str]) -> Self
pub fn _source_includes(self, _source_includes: &'b [&'b str]) -> Self
Default list of fields to extract and return from the _source field, can be overridden on each sub-request
Sourcepub fn body<T>(self, body: Vec<T>) -> Bulk<'a, 'b, NdBody<T>>where
T: Body,
pub fn body<T>(self, body: Vec<T>) -> Bulk<'a, 'b, NdBody<T>>where
T: Body,
The body for the API call
Sourcepub fn error_trace(self, error_trace: bool) -> Self
pub fn error_trace(self, error_trace: bool) -> Self
Include the stack trace of returned errors.
Sourcepub fn filter_path(self, filter_path: &'b [&'b str]) -> Self
pub fn filter_path(self, filter_path: &'b [&'b str]) -> Self
A comma-separated list of filters used to reduce the response.
Sourcepub fn header(self, key: HeaderName, value: HeaderValue) -> Self
pub fn header(self, key: HeaderName, value: HeaderValue) -> Self
Adds a HTTP header
Sourcepub fn include_source_on_error(self, include_source_on_error: bool) -> Self
pub fn include_source_on_error(self, include_source_on_error: bool) -> Self
True or false if to include the document source in the error message in case of parsing errors. Defaults to true.
Sourcepub fn list_executed_pipelines(self, list_executed_pipelines: bool) -> Self
pub fn list_executed_pipelines(self, list_executed_pipelines: bool) -> Self
Sets list_executed_pipelines for all incoming documents. Defaults to unset (false)
Sourcepub fn pipeline(self, pipeline: &'b str) -> Self
pub fn pipeline(self, pipeline: &'b str) -> Self
The pipeline id to preprocess incoming documents with
Sourcepub fn refresh(self, refresh: Refresh) -> Self
pub fn refresh(self, refresh: Refresh) -> Self
If true
then refresh the affected shards to make this operation visible to search, if wait_for
then wait for a refresh to make this operation visible to search, if false
(the default) then do nothing with refreshes.
Sourcepub fn request_timeout(self, timeout: Duration) -> Self
pub fn request_timeout(self, timeout: Duration) -> Self
Sets a request timeout for this API call.
The timeout is applied from when the request starts connecting until the response body has finished.
Sourcepub fn require_alias(self, require_alias: bool) -> Self
pub fn require_alias(self, require_alias: bool) -> Self
If true, the request’s actions must target an index alias. Defaults to false.
Sourcepub fn require_data_stream(self, require_data_stream: bool) -> Self
pub fn require_data_stream(self, require_data_stream: bool) -> Self
If true, the request’s actions must target a data stream (existing or to-be-created). Default to false
Sourcepub fn source(self, source: &'b str) -> Self
pub fn source(self, source: &'b str) -> Self
The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
Sourcepub fn wait_for_active_shards(self, wait_for_active_shards: &'b str) -> Self
pub fn wait_for_active_shards(self, wait_for_active_shards: &'b str) -> Self
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 to all
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)