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 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 = OpenSearch::default();
let response = client
    .indices()
    .create(IndicesCreateParts::Index("test_index"))
    .body(json!({
        "mappings" : {
            "properties" : {
                "field1" : { "type" : "text" }
            }
        }
    }))
    .send()
    .await?;
    
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_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 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 exists_type<'b>( &'a self, parts: IndicesExistsTypeParts<'b>, ) -> IndicesExistsType<'a, 'b>

Indices Exists Type API

Returns information about whether a particular document type exists. (DEPRECATED)

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 flush_synced<'b>( &'a self, parts: IndicesFlushSyncedParts<'b>, ) -> IndicesFlushSynced<'a, 'b, ()>

Indices Flush Synced API

Performs a synced flush operation on one or more indices. Synced flush is deprecated and will be removed in 8.0. Use flush instead

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_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_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 get_upgrade<'b>( &'a self, parts: IndicesGetUpgradeParts<'b>, ) -> IndicesGetUpgrade<'a, 'b>

Indices Get Upgrade API

DEPRECATED Returns a progress status of current upgrade.

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 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_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 = OpenSearch::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_index<'b>( &'a self, parts: IndicesResolveIndexParts<'b>, ) -> IndicesResolveIndex<'a, 'b>

Indices Resolve Index API

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

§Optional, experimental

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

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 unfreeze<'b>( &'a self, parts: IndicesUnfreezeParts<'b>, ) -> IndicesUnfreeze<'a, 'b, ()>

Indices Unfreeze API

Unfreezes an index. When a frozen index is unfrozen, the index goes through the normal recovery process and becomes writeable again.

Source

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

Indices Update Aliases API

Updates index aliases.

Source

pub fn upgrade<'b>( &'a self, parts: IndicesUpgradeParts<'b>, ) -> IndicesUpgrade<'a, 'b, ()>

Indices Upgrade API

DEPRECATED Upgrades to the current version of Lucene.

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,