Struct elasticsearch::UpdateByQuery
source · [−]pub struct UpdateByQuery<'a, 'b, B> { /* private fields */ }
Expand description
Builder for the Update By Query API
Performs an update on every document in the index without changing the source, for example to pick up a mapping change.
Implementations
sourceimpl<'a, 'b, B> UpdateByQuery<'a, 'b, B> where
B: Body,
impl<'a, 'b, B> UpdateByQuery<'a, 'b, B> where
B: Body,
sourcepub fn new(transport: &'a Transport, parts: UpdateByQueryParts<'b>) -> Self
pub fn new(transport: &'a Transport, parts: UpdateByQueryParts<'b>) -> Self
Creates a new instance of UpdateByQuery 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 a list of fields to return
sourcepub fn _source_excludes(self, _source_excludes: &'b [&'b str]) -> Self
pub fn _source_excludes(self, _source_excludes: &'b [&'b str]) -> Self
A list of fields to exclude from the returned _source field
sourcepub fn _source_includes(self, _source_includes: &'b [&'b str]) -> Self
pub fn _source_includes(self, _source_includes: &'b [&'b str]) -> Self
A list of fields to extract and return from the _source field
sourcepub fn allow_no_indices(self, allow_no_indices: bool) -> Self
pub fn allow_no_indices(self, allow_no_indices: bool) -> Self
Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes _all
string or when no indices have been specified)
sourcepub fn analyze_wildcard(self, analyze_wildcard: bool) -> Self
pub fn analyze_wildcard(self, analyze_wildcard: bool) -> Self
Specify whether wildcard and prefix queries should be analyzed (default: false)
sourcepub fn body<T>(self, body: T) -> UpdateByQuery<'a, 'b, JsonBody<T>> where
T: Serialize,
pub fn body<T>(self, body: T) -> UpdateByQuery<'a, 'b, JsonBody<T>> where
T: Serialize,
The body for the API call
sourcepub fn conflicts(self, conflicts: Conflicts) -> Self
pub fn conflicts(self, conflicts: Conflicts) -> Self
What to do when the update by query hits version conflicts?
sourcepub fn default_operator(self, default_operator: DefaultOperator) -> Self
pub fn default_operator(self, default_operator: DefaultOperator) -> Self
The default operator for query string query (AND or OR)
sourcepub fn df(self, df: &'b str) -> Self
pub fn df(self, df: &'b str) -> Self
The field to use as default where no field prefix is given in the query string
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 expand_wildcards(self, expand_wildcards: &'b [ExpandWildcards]) -> Self
pub fn expand_wildcards(self, expand_wildcards: &'b [ExpandWildcards]) -> Self
Whether to expand wildcard expression to concrete indices that are open, closed or both.
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
Whether specified concrete indices should be ignored when unavailable (missing or closed)
sourcepub fn lenient(self, lenient: bool) -> Self
pub fn lenient(self, lenient: bool) -> Self
Specify whether format-based query failures (such as providing text to a numeric field) should be ignored
sourcepub fn max_docs(self, max_docs: i64) -> Self
pub fn max_docs(self, max_docs: i64) -> Self
Maximum number of documents to process (default: all documents)
sourcepub fn pipeline(self, pipeline: &'b str) -> Self
pub fn pipeline(self, pipeline: &'b str) -> Self
Ingest pipeline to set on index requests made by this action. (default: none)
sourcepub fn preference(self, preference: &'b str) -> Self
pub fn preference(self, preference: &'b str) -> Self
Specify the node or shard the operation should be performed on (default: random)
sourcepub fn request_cache(self, request_cache: bool) -> Self
pub fn request_cache(self, request_cache: bool) -> Self
Specify if request cache should be used for this request or not, defaults to index level setting
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 requests_per_second(self, requests_per_second: i64) -> Self
pub fn requests_per_second(self, requests_per_second: i64) -> Self
The throttle to set on this request in sub-requests per second. -1 means no throttle.
sourcepub fn routing(self, routing: &'b [&'b str]) -> Self
pub fn routing(self, routing: &'b [&'b str]) -> Self
A comma-separated list of specific routing values
sourcepub fn scroll(self, scroll: &'b str) -> Self
pub fn scroll(self, scroll: &'b str) -> Self
Specify how long a consistent view of the index should be maintained for scrolled search
sourcepub fn scroll_size(self, scroll_size: i64) -> Self
pub fn scroll_size(self, scroll_size: i64) -> Self
Size on the scroll request powering the update by query
sourcepub fn search_timeout(self, search_timeout: &'b str) -> Self
pub fn search_timeout(self, search_timeout: &'b str) -> Self
Explicit timeout for each search request. Defaults to no timeout.
sourcepub fn search_type(self, search_type: SearchType) -> Self
pub fn search_type(self, search_type: SearchType) -> Self
Search operation type
sourcepub fn slices(self, slices: Slices) -> Self
pub fn slices(self, slices: Slices) -> Self
The number of slices this task should be divided into. Defaults to 1, meaning the task isn’t sliced into subtasks. Can be set to auto
.
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 stats(self, stats: &'b [&'b str]) -> Self
pub fn stats(self, stats: &'b [&'b str]) -> Self
Specific ‘tag’ of the request for logging and statistical purposes
sourcepub fn terminate_after(self, terminate_after: i64) -> Self
pub fn terminate_after(self, terminate_after: i64) -> Self
The maximum number of documents to collect for each shard, upon reaching which the query execution will terminate early.
sourcepub fn timeout(self, timeout: &'b str) -> Self
pub fn timeout(self, timeout: &'b str) -> Self
Time each individual bulk request should wait for shards that are unavailable.
sourcepub fn version(self, version: bool) -> Self
pub fn version(self, version: bool) -> Self
Specify whether to return document version as part of a hit
sourcepub fn version_type(self, version_type: bool) -> Self
pub fn version_type(self, version_type: bool) -> Self
Should the document increment the version number (internal) on hit or not (reindex)
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 update by query 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)
sourcepub fn wait_for_completion(self, wait_for_completion: bool) -> Self
pub fn wait_for_completion(self, wait_for_completion: bool) -> Self
Should the request should block until the update by query operation is complete.
Trait Implementations
sourceimpl<'a, 'b, B: Clone> Clone for UpdateByQuery<'a, 'b, B>
impl<'a, 'b, B: Clone> Clone for UpdateByQuery<'a, 'b, B>
sourcefn clone(&self) -> UpdateByQuery<'a, 'b, B>
fn clone(&self) -> UpdateByQuery<'a, 'b, B>
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
Auto Trait Implementations
impl<'a, 'b, B> !RefUnwindSafe for UpdateByQuery<'a, 'b, B>
impl<'a, 'b, B> Send for UpdateByQuery<'a, 'b, B> where
B: Send,
impl<'a, 'b, B> Sync for UpdateByQuery<'a, 'b, B> where
B: Sync,
impl<'a, 'b, B> Unpin for UpdateByQuery<'a, 'b, B> where
B: Unpin,
impl<'a, 'b, B> !UnwindSafe for UpdateByQuery<'a, 'b, B>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more