Struct elasticsearch::Index
source · [−]pub struct Index<'a, 'b, B> { /* private fields */ }
Expand description
Builder for the Index API
Creates or updates a document in an index.
Implementations
sourceimpl<'a, 'b, B> Index<'a, 'b, B> where
B: Body,
impl<'a, 'b, B> Index<'a, 'b, B> where
B: Body,
sourcepub fn new(transport: &'a Transport, parts: IndexParts<'b>) -> Self
pub fn new(transport: &'a Transport, parts: IndexParts<'b>) -> Self
Creates a new instance of Index with the specified API parts
sourcepub fn body<T>(self, body: T) -> Index<'a, 'b, JsonBody<T>> where
T: Serialize,
pub fn body<T>(self, body: T) -> Index<'a, 'b, JsonBody<T>> where
T: Serialize,
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 if_primary_term(self, if_primary_term: i64) -> Self
pub fn if_primary_term(self, if_primary_term: i64) -> Self
only perform the index operation if the last operation that has changed the document has the specified primary term
sourcepub fn if_seq_no(self, if_seq_no: i64) -> Self
pub fn if_seq_no(self, if_seq_no: i64) -> Self
only perform the index operation if the last operation that has changed the document has the specified sequence number
sourcepub fn op_type(self, op_type: OpType) -> Self
pub fn op_type(self, op_type: OpType) -> Self
Explicit operation type. Defaults to index
for requests with an explicit document ID, and to create
for requests without an explicit document ID
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
When true, requires destination to be an alias. Default is 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 version_type(self, version_type: VersionType) -> Self
pub fn version_type(self, version_type: VersionType) -> Self
Specific version type
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 index 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)
Trait Implementations
Auto Trait Implementations
impl<'a, 'b, B> !RefUnwindSafe for Index<'a, 'b, B>
impl<'a, 'b, B> Send for Index<'a, 'b, B> where
B: Send,
impl<'a, 'b, B> Sync for Index<'a, 'b, B> where
B: Sync,
impl<'a, 'b, B> Unpin for Index<'a, 'b, B> where
B: Unpin,
impl<'a, 'b, B> !UnwindSafe for Index<'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