Struct Indices

Source
pub struct Indices<'a> { /* private fields */ }
Expand description

Namespace client for Indices APIs

Implementations§

Source§

impl<'a> Indices<'a>

Source

pub fn new(transport: &'a Transport) -> Self

Creates a new instance of Indices

Source

pub fn transport(&self) -> &Transport

Source

pub fn add_block<'b>( &'a self, parts: IndicesAddBlockParts<'b>, ) -> IndicesAddBlock<'a, 'b, ()>

Indices Add Block API

Adds a block to an index.

Source

pub fn analyze<'b>( &'a self, parts: IndicesAnalyzeParts<'b>, ) -> IndicesAnalyze<'a, 'b, ()>

Indices Analyze API

Performs the analysis process on a text and return the tokens breakdown of the text.

Source

pub fn cancel_migrate_reindex<'b>( &'a self, parts: IndicesCancelMigrateReindexParts<'b>, ) -> IndicesCancelMigrateReindex<'a, 'b, ()>

Indices Cancel Migrate Reindex API

This API returns the status of a migration reindex attempt for a data stream or index  

§Optional, experimental

This requires the experimental-apis feature. Can have breaking changes in future versions or might even be removed entirely.

Source

pub fn clear_cache<'b>( &'a self, parts: IndicesClearCacheParts<'b>, ) -> IndicesClearCache<'a, 'b, ()>

Indices Clear Cache API

Clears all or specific caches for one or more indices.

Source

pub fn clone<'b>( &'a self, parts: IndicesCloneParts<'b>, ) -> IndicesClone<'a, 'b, ()>

Indices Clone API

Clones an index

Source

pub fn close<'b>( &'a self, parts: IndicesCloseParts<'b>, ) -> IndicesClose<'a, 'b, ()>

Indices Close API

Closes an index.

Source

pub fn create<'b>( &'a self, parts: IndicesCreateParts<'b>, ) -> IndicesCreate<'a, 'b, ()>

Indices Create API

Creates an index with optional settings and mappings.

§Examples

Create an index with a mapping

let client = Elasticsearch::default();
let response = client
    .indices()
    .create(IndicesCreateParts::Index("test_index"))
    .body(json!({
        "mappings" : {
            "properties" : {
                "field1" : { "type" : "text" }
            }
        }
    }))
    .send()
    .await?;
    
Source

pub fn create_data_stream<'b>( &'a self, parts: IndicesCreateDataStreamParts<'b>, ) -> IndicesCreateDataStream<'a, 'b, ()>

Indices Create Data Stream API

Creates a data stream

Source

pub fn create_from<'b>( &'a self, parts: IndicesCreateFromParts<'b>, ) -> IndicesCreateFrom<'a, 'b, ()>

Indices Create From API

This API creates a destination from a source index. It copies the mappings and settings from the source index while allowing request settings and mappings to override the source values.  

§Optional, experimental

This requires the experimental-apis feature. Can have breaking changes in future versions or might even be removed entirely.

Source

pub fn data_streams_stats<'b>( &'a self, parts: IndicesDataStreamsStatsParts<'b>, ) -> IndicesDataStreamsStats<'a, 'b>

Indices Data Streams Stats API

Provides statistics on operations happening in a data stream.

Source

pub fn delete<'b>( &'a self, parts: IndicesDeleteParts<'b>, ) -> IndicesDelete<'a, 'b>

Indices Delete API

Deletes an index.

Source

pub fn delete_alias<'b>( &'a self, parts: IndicesDeleteAliasParts<'b>, ) -> IndicesDeleteAlias<'a, 'b>

Indices Delete Alias API

Deletes an alias.

Source

pub fn delete_data_lifecycle<'b>( &'a self, parts: IndicesDeleteDataLifecycleParts<'b>, ) -> IndicesDeleteDataLifecycle<'a, 'b>

Indices Delete Data Lifecycle API

Deletes the data stream lifecycle of the selected data streams.

Source

pub fn delete_data_stream<'b>( &'a self, parts: IndicesDeleteDataStreamParts<'b>, ) -> IndicesDeleteDataStream<'a, 'b>

Indices Delete Data Stream API

Deletes a data stream.

Source

pub fn delete_index_template<'b>( &'a self, parts: IndicesDeleteIndexTemplateParts<'b>, ) -> IndicesDeleteIndexTemplate<'a, 'b>

Indices Delete Index Template API

Deletes an index template.

Source

pub fn delete_template<'b>( &'a self, parts: IndicesDeleteTemplateParts<'b>, ) -> IndicesDeleteTemplate<'a, 'b>

Indices Delete Template API

Deletes an index template.

Source

pub fn disk_usage<'b>( &'a self, parts: IndicesDiskUsageParts<'b>, ) -> IndicesDiskUsage<'a, 'b, ()>

Indices Disk Usage API

Analyzes the disk usage of each field of an index or data stream  

§Optional, experimental

This requires the experimental-apis feature. Can have breaking changes in future versions or might even be removed entirely.

Source

pub fn downsample<'b>( &'a self, parts: IndicesDownsampleParts<'b>, ) -> IndicesDownsample<'a, 'b, ()>

Indices Downsample API

Downsample an index  

§Optional, experimental

This requires the experimental-apis feature. Can have breaking changes in future versions or might even be removed entirely.

Source

pub fn exists<'b>( &'a self, parts: IndicesExistsParts<'b>, ) -> IndicesExists<'a, 'b>

Indices Exists API

Returns information about whether a particular index exists.

Source

pub fn exists_alias<'b>( &'a self, parts: IndicesExistsAliasParts<'b>, ) -> IndicesExistsAlias<'a, 'b>

Indices Exists Alias API

Returns information about whether a particular alias exists.

Source

pub fn exists_index_template<'b>( &'a self, parts: IndicesExistsIndexTemplateParts<'b>, ) -> IndicesExistsIndexTemplate<'a, 'b>

Indices Exists Index Template API

Returns information about whether a particular index template exists.

Source

pub fn exists_template<'b>( &'a self, parts: IndicesExistsTemplateParts<'b>, ) -> IndicesExistsTemplate<'a, 'b>

Indices Exists Template API

Returns information about whether a particular index template exists.

Source

pub fn explain_data_lifecycle<'b>( &'a self, parts: IndicesExplainDataLifecycleParts<'b>, ) -> IndicesExplainDataLifecycle<'a, 'b>

Indices Explain Data Lifecycle API

Retrieves information about the index’s current data stream lifecycle, such as any potential encountered error, time since creation etc.

Source

pub fn field_usage_stats<'b>( &'a self, parts: IndicesFieldUsageStatsParts<'b>, ) -> IndicesFieldUsageStats<'a, 'b>

Indices Field Usage Stats API

Returns the field usage stats for each field of an index  

§Optional, experimental

This requires the experimental-apis feature. Can have breaking changes in future versions or might even be removed entirely.

Source

pub fn flush<'b>( &'a self, parts: IndicesFlushParts<'b>, ) -> IndicesFlush<'a, 'b, ()>

Indices Flush API

Performs the flush operation on one or more indices.

Source

pub fn forcemerge<'b>( &'a self, parts: IndicesForcemergeParts<'b>, ) -> IndicesForcemerge<'a, 'b, ()>

Indices Forcemerge API

Performs the force merge operation on one or more indices.

Source

pub fn get<'b>(&'a self, parts: IndicesGetParts<'b>) -> IndicesGet<'a, 'b>

Indices Get API

Returns information about one or more indices.

Source

pub fn get_alias<'b>( &'a self, parts: IndicesGetAliasParts<'b>, ) -> IndicesGetAlias<'a, 'b>

Indices Get Alias API

Returns an alias.

Source

pub fn get_data_lifecycle<'b>( &'a self, parts: IndicesGetDataLifecycleParts<'b>, ) -> IndicesGetDataLifecycle<'a, 'b>

Indices Get Data Lifecycle API

Returns the data stream lifecycle of the selected data streams.

Source

pub fn get_data_lifecycle_stats<'b>( &'a self, ) -> IndicesGetDataLifecycleStats<'a, 'b>

Indices Get Data Lifecycle Stats API

Get data stream lifecycle statistics.

Source

pub fn get_data_stream<'b>( &'a self, parts: IndicesGetDataStreamParts<'b>, ) -> IndicesGetDataStream<'a, 'b>

Indices Get Data Stream API

Returns data streams.

Source

pub fn get_field_mapping<'b>( &'a self, parts: IndicesGetFieldMappingParts<'b>, ) -> IndicesGetFieldMapping<'a, 'b>

Indices Get Field Mapping API

Returns mapping for one or more fields.

Source

pub fn get_index_template<'b>( &'a self, parts: IndicesGetIndexTemplateParts<'b>, ) -> IndicesGetIndexTemplate<'a, 'b>

Indices Get Index Template API

Returns an index template.

Source

pub fn get_mapping<'b>( &'a self, parts: IndicesGetMappingParts<'b>, ) -> IndicesGetMapping<'a, 'b>

Indices Get Mapping API

Returns mappings for one or more indices.

Source

pub fn get_migrate_reindex_status<'b>( &'a self, parts: IndicesGetMigrateReindexStatusParts<'b>, ) -> IndicesGetMigrateReindexStatus<'a, 'b>

Indices Get Migrate Reindex Status API

This API returns the status of a migration reindex attempt for a data stream or index  

§Optional, experimental

This requires the experimental-apis feature. Can have breaking changes in future versions or might even be removed entirely.

Source

pub fn get_settings<'b>( &'a self, parts: IndicesGetSettingsParts<'b>, ) -> IndicesGetSettings<'a, 'b>

Indices Get Settings API

Returns settings for one or more indices.

Source

pub fn get_template<'b>( &'a self, parts: IndicesGetTemplateParts<'b>, ) -> IndicesGetTemplate<'a, 'b>

Indices Get Template API

Returns an index template.

Source

pub fn migrate_reindex<'b>(&'a self) -> IndicesMigrateReindex<'a, 'b, ()>

Indices Migrate Reindex API

This API reindexes all legacy backing indices for a data stream. It does this in a persistent task. The persistent task id is returned immediately, and the reindexing work is completed in that task  

§Optional, experimental

This requires the experimental-apis feature. Can have breaking changes in future versions or might even be removed entirely.

Source

pub fn migrate_to_data_stream<'b>( &'a self, parts: IndicesMigrateToDataStreamParts<'b>, ) -> IndicesMigrateToDataStream<'a, 'b, ()>

Indices Migrate To Data Stream API

Migrates an alias to a data stream

Source

pub fn modify_data_stream<'b>(&'a self) -> IndicesModifyDataStream<'a, 'b, ()>

Indices Modify Data Stream API

Modifies a data stream

Source

pub fn open<'b>( &'a self, parts: IndicesOpenParts<'b>, ) -> IndicesOpen<'a, 'b, ()>

Indices Open API

Opens an index.

Source

pub fn promote_data_stream<'b>( &'a self, parts: IndicesPromoteDataStreamParts<'b>, ) -> IndicesPromoteDataStream<'a, 'b, ()>

Indices Promote Data Stream API

Promotes a data stream from a replicated data stream managed by CCR to a regular data stream

Source

pub fn put_alias<'b>( &'a self, parts: IndicesPutAliasParts<'b>, ) -> IndicesPutAlias<'a, 'b, ()>

Indices Put Alias API

Creates or updates an alias.

Source

pub fn put_data_lifecycle<'b>( &'a self, parts: IndicesPutDataLifecycleParts<'b>, ) -> IndicesPutDataLifecycle<'a, 'b, ()>

Indices Put Data Lifecycle API

Updates the data stream lifecycle of the selected data streams.

Source

pub fn put_index_template<'b>( &'a self, parts: IndicesPutIndexTemplateParts<'b>, ) -> IndicesPutIndexTemplate<'a, 'b, ()>

Indices Put Index Template API

Creates or updates an index template.

Source

pub fn put_mapping<'b>( &'a self, parts: IndicesPutMappingParts<'b>, ) -> IndicesPutMapping<'a, 'b, ()>

Indices Put Mapping API

Updates the index mappings.

§Examples

Put a mapping into an existing index, assuming the index does not have a mapping, or that any properties specified do not conflict with existing properties

let client = Elasticsearch::default();
let response = client
    .indices()
    .put_mapping(IndicesPutMappingParts::Index(&["test_index"]))
    .body(json!({
        "properties" : {
            "field1" : { "type" : "text" }
        }
    }))
    .send()
    .await?;
    
Source

pub fn put_settings<'b>( &'a self, parts: IndicesPutSettingsParts<'b>, ) -> IndicesPutSettings<'a, 'b, ()>

Indices Put Settings API

Updates the index settings.

Source

pub fn put_template<'b>( &'a self, parts: IndicesPutTemplateParts<'b>, ) -> IndicesPutTemplate<'a, 'b, ()>

Indices Put Template API

Creates or updates an index template.

Source

pub fn recovery<'b>( &'a self, parts: IndicesRecoveryParts<'b>, ) -> IndicesRecovery<'a, 'b>

Indices Recovery API

Returns information about ongoing index shard recoveries.

Source

pub fn refresh<'b>( &'a self, parts: IndicesRefreshParts<'b>, ) -> IndicesRefresh<'a, 'b, ()>

Indices Refresh API

Performs the refresh operation in one or more indices.

Source

pub fn reload_search_analyzers<'b>( &'a self, parts: IndicesReloadSearchAnalyzersParts<'b>, ) -> IndicesReloadSearchAnalyzers<'a, 'b, ()>

Indices Reload Search Analyzers API

Reloads an index’s search analyzers and their resources.

Source

pub fn resolve_cluster<'b>( &'a self, parts: IndicesResolveClusterParts<'b>, ) -> IndicesResolveCluster<'a, 'b>

Indices Resolve Cluster API

Resolves the specified index expressions to return information about each cluster. If no index expression is provided, this endpoint will return information about all the remote clusters that are configured on the local cluster.

Source

pub fn resolve_index<'b>( &'a self, parts: IndicesResolveIndexParts<'b>, ) -> IndicesResolveIndex<'a, 'b>

Indices Resolve Index API

Returns information about any matching indices, aliases, and data streams

Source

pub fn rollover<'b>( &'a self, parts: IndicesRolloverParts<'b>, ) -> IndicesRollover<'a, 'b, ()>

Indices Rollover API

Updates an alias to point to a new index when the existing index is considered to be too large or too old.

Source

pub fn segments<'b>( &'a self, parts: IndicesSegmentsParts<'b>, ) -> IndicesSegments<'a, 'b>

Indices Segments API

Provides low-level information about segments in a Lucene index.

Source

pub fn shard_stores<'b>( &'a self, parts: IndicesShardStoresParts<'b>, ) -> IndicesShardStores<'a, 'b>

Indices Shard Stores API

Provides store information for shard copies of indices.

Source

pub fn shrink<'b>( &'a self, parts: IndicesShrinkParts<'b>, ) -> IndicesShrink<'a, 'b, ()>

Indices Shrink API

Allow to shrink an existing index into a new index with fewer primary shards.

Source

pub fn simulate_index_template<'b>( &'a self, parts: IndicesSimulateIndexTemplateParts<'b>, ) -> IndicesSimulateIndexTemplate<'a, 'b, ()>

Indices Simulate Index Template API

Simulate matching the given index name against the index templates in the system

Source

pub fn simulate_template<'b>( &'a self, parts: IndicesSimulateTemplateParts<'b>, ) -> IndicesSimulateTemplate<'a, 'b, ()>

Indices Simulate Template API

Simulate resolving the given template name or body

Source

pub fn split<'b>( &'a self, parts: IndicesSplitParts<'b>, ) -> IndicesSplit<'a, 'b, ()>

Indices Split API

Allows you to split an existing index into a new index with more primary shards.

Source

pub fn stats<'b>(&'a self, parts: IndicesStatsParts<'b>) -> IndicesStats<'a, 'b>

Indices Stats API

Provides statistics on operations happening in an index.

Source

pub fn update_aliases<'b>(&'a self) -> IndicesUpdateAliases<'a, 'b, ()>

Indices Update Aliases API

Updates index aliases.

Source

pub fn validate_query<'b>( &'a self, parts: IndicesValidateQueryParts<'b>, ) -> IndicesValidateQuery<'a, 'b, ()>

Indices Validate Query API

Allows a user to validate a potentially expensive query without executing it.

Auto Trait Implementations§

§

impl<'a> Freeze for Indices<'a>

§

impl<'a> !RefUnwindSafe for Indices<'a>

§

impl<'a> Send for Indices<'a>

§

impl<'a> Sync for Indices<'a>

§

impl<'a> Unpin for Indices<'a>

§

impl<'a> !UnwindSafe for Indices<'a>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

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
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<T> ErasedDestructor for T
where T: 'static,

Source§

impl<A, B, T> HttpServerConnExec<A, B> for T
where B: Body,

Source§

impl<T> MaybeSendSync for T