Struct elasticsearch::indices::Indices
source · [−]pub struct Indices<'a> { /* private fields */ }
Expand description
Namespace client for Indices APIs
Implementations
sourceimpl<'a> Indices<'a>
impl<'a> Indices<'a>
pub fn transport(&self) -> &Transport
sourcepub fn add_block<'b>(
&'a self,
parts: IndicesAddBlockParts<'b>
) -> IndicesAddBlock<'a, 'b, ()>
pub fn add_block<'b>(
&'a self,
parts: IndicesAddBlockParts<'b>
) -> IndicesAddBlock<'a, 'b, ()>
Adds a block to an index.
sourcepub fn analyze<'b>(
&'a self,
parts: IndicesAnalyzeParts<'b>
) -> IndicesAnalyze<'a, 'b, ()>
pub fn analyze<'b>(
&'a self,
parts: IndicesAnalyzeParts<'b>
) -> IndicesAnalyze<'a, 'b, ()>
Performs the analysis process on a text and return the tokens breakdown of the text.
sourcepub fn clear_cache<'b>(
&'a self,
parts: IndicesClearCacheParts<'b>
) -> IndicesClearCache<'a, 'b, ()>
pub fn clear_cache<'b>(
&'a self,
parts: IndicesClearCacheParts<'b>
) -> IndicesClearCache<'a, 'b, ()>
Clears all or specific caches for one or more indices.
sourcepub fn clone<'b>(
&'a self,
parts: IndicesCloneParts<'b>
) -> IndicesClone<'a, 'b, ()>
pub fn clone<'b>(
&'a self,
parts: IndicesCloneParts<'b>
) -> IndicesClone<'a, 'b, ()>
Clones an index
sourcepub fn close<'b>(
&'a self,
parts: IndicesCloseParts<'b>
) -> IndicesClose<'a, 'b, ()>
pub fn close<'b>(
&'a self,
parts: IndicesCloseParts<'b>
) -> IndicesClose<'a, 'b, ()>
Closes an index.
sourcepub fn create<'b>(
&'a self,
parts: IndicesCreateParts<'b>
) -> IndicesCreate<'a, 'b, ()>
pub fn create<'b>(
&'a self,
parts: IndicesCreateParts<'b>
) -> IndicesCreate<'a, 'b, ()>
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?;
sourcepub fn create_data_stream<'b>(
&'a self,
parts: IndicesCreateDataStreamParts<'b>
) -> IndicesCreateDataStream<'a, 'b, ()>
pub fn create_data_stream<'b>(
&'a self,
parts: IndicesCreateDataStreamParts<'b>
) -> IndicesCreateDataStream<'a, 'b, ()>
Indices Create Data Stream API
Creates a data stream
sourcepub fn data_streams_stats<'b>(
&'a self,
parts: IndicesDataStreamsStatsParts<'b>
) -> IndicesDataStreamsStats<'a, 'b>
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.
sourcepub fn delete<'b>(
&'a self,
parts: IndicesDeleteParts<'b>
) -> IndicesDelete<'a, 'b>
pub fn delete<'b>(
&'a self,
parts: IndicesDeleteParts<'b>
) -> IndicesDelete<'a, 'b>
Deletes an index.
sourcepub fn delete_alias<'b>(
&'a self,
parts: IndicesDeleteAliasParts<'b>
) -> IndicesDeleteAlias<'a, 'b>
pub fn delete_alias<'b>(
&'a self,
parts: IndicesDeleteAliasParts<'b>
) -> IndicesDeleteAlias<'a, 'b>
Deletes an alias.
sourcepub fn delete_data_stream<'b>(
&'a self,
parts: IndicesDeleteDataStreamParts<'b>
) -> IndicesDeleteDataStream<'a, 'b>
pub fn delete_data_stream<'b>(
&'a self,
parts: IndicesDeleteDataStreamParts<'b>
) -> IndicesDeleteDataStream<'a, 'b>
Indices Delete Data Stream API
Deletes a data stream.
sourcepub fn delete_index_template<'b>(
&'a self,
parts: IndicesDeleteIndexTemplateParts<'b>
) -> IndicesDeleteIndexTemplate<'a, 'b>
pub fn delete_index_template<'b>(
&'a self,
parts: IndicesDeleteIndexTemplateParts<'b>
) -> IndicesDeleteIndexTemplate<'a, 'b>
Indices Delete Index Template API
Deletes an index template.
sourcepub fn delete_template<'b>(
&'a self,
parts: IndicesDeleteTemplateParts<'b>
) -> IndicesDeleteTemplate<'a, 'b>
pub fn delete_template<'b>(
&'a self,
parts: IndicesDeleteTemplateParts<'b>
) -> IndicesDeleteTemplate<'a, 'b>
Deletes an index template.
sourcepub fn exists<'b>(
&'a self,
parts: IndicesExistsParts<'b>
) -> IndicesExists<'a, 'b>
pub fn exists<'b>(
&'a self,
parts: IndicesExistsParts<'b>
) -> IndicesExists<'a, 'b>
Returns information about whether a particular index exists.
sourcepub fn exists_alias<'b>(
&'a self,
parts: IndicesExistsAliasParts<'b>
) -> IndicesExistsAlias<'a, 'b>
pub fn exists_alias<'b>(
&'a self,
parts: IndicesExistsAliasParts<'b>
) -> IndicesExistsAlias<'a, 'b>
Returns information about whether a particular alias exists.
sourcepub fn exists_index_template<'b>(
&'a self,
parts: IndicesExistsIndexTemplateParts<'b>
) -> IndicesExistsIndexTemplate<'a, 'b>
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.
sourcepub fn exists_template<'b>(
&'a self,
parts: IndicesExistsTemplateParts<'b>
) -> IndicesExistsTemplate<'a, 'b>
pub fn exists_template<'b>(
&'a self,
parts: IndicesExistsTemplateParts<'b>
) -> IndicesExistsTemplate<'a, 'b>
Returns information about whether a particular index template exists.
sourcepub fn exists_type<'b>(
&'a self,
parts: IndicesExistsTypeParts<'b>
) -> IndicesExistsType<'a, 'b>
pub fn exists_type<'b>(
&'a self,
parts: IndicesExistsTypeParts<'b>
) -> IndicesExistsType<'a, 'b>
Returns information about whether a particular document type exists. (DEPRECATED)
sourcepub fn flush<'b>(
&'a self,
parts: IndicesFlushParts<'b>
) -> IndicesFlush<'a, 'b, ()>
pub fn flush<'b>(
&'a self,
parts: IndicesFlushParts<'b>
) -> IndicesFlush<'a, 'b, ()>
Performs the flush operation on one or more indices.
sourcepub fn flush_synced<'b>(
&'a self,
parts: IndicesFlushSyncedParts<'b>
) -> IndicesFlushSynced<'a, 'b, ()>
pub fn flush_synced<'b>(
&'a self,
parts: IndicesFlushSyncedParts<'b>
) -> IndicesFlushSynced<'a, 'b, ()>
Performs a synced flush operation on one or more indices. Synced flush is deprecated and will be removed in 8.0. Use flush instead
sourcepub fn forcemerge<'b>(
&'a self,
parts: IndicesForcemergeParts<'b>
) -> IndicesForcemerge<'a, 'b, ()>
pub fn forcemerge<'b>(
&'a self,
parts: IndicesForcemergeParts<'b>
) -> IndicesForcemerge<'a, 'b, ()>
Performs the force merge operation on one or more indices.
sourcepub fn freeze<'b>(
&'a self,
parts: IndicesFreezeParts<'b>
) -> IndicesFreeze<'a, 'b, ()>
pub fn freeze<'b>(
&'a self,
parts: IndicesFreezeParts<'b>
) -> IndicesFreeze<'a, 'b, ()>
Freezes an index. A frozen index has almost no overhead on the cluster (except for maintaining its metadata in memory) and is read-only.
sourcepub fn get<'b>(&'a self, parts: IndicesGetParts<'b>) -> IndicesGet<'a, 'b>
pub fn get<'b>(&'a self, parts: IndicesGetParts<'b>) -> IndicesGet<'a, 'b>
Returns information about one or more indices.
sourcepub fn get_alias<'b>(
&'a self,
parts: IndicesGetAliasParts<'b>
) -> IndicesGetAlias<'a, 'b>
pub fn get_alias<'b>(
&'a self,
parts: IndicesGetAliasParts<'b>
) -> IndicesGetAlias<'a, 'b>
Returns an alias.
sourcepub fn get_data_stream<'b>(
&'a self,
parts: IndicesGetDataStreamParts<'b>
) -> IndicesGetDataStream<'a, 'b>
pub fn get_data_stream<'b>(
&'a self,
parts: IndicesGetDataStreamParts<'b>
) -> IndicesGetDataStream<'a, 'b>
Returns data streams.
sourcepub fn get_field_mapping<'b>(
&'a self,
parts: IndicesGetFieldMappingParts<'b>
) -> IndicesGetFieldMapping<'a, 'b>
pub fn get_field_mapping<'b>(
&'a self,
parts: IndicesGetFieldMappingParts<'b>
) -> IndicesGetFieldMapping<'a, 'b>
Returns mapping for one or more fields.
sourcepub fn get_index_template<'b>(
&'a self,
parts: IndicesGetIndexTemplateParts<'b>
) -> IndicesGetIndexTemplate<'a, 'b>
pub fn get_index_template<'b>(
&'a self,
parts: IndicesGetIndexTemplateParts<'b>
) -> IndicesGetIndexTemplate<'a, 'b>
Indices Get Index Template API
Returns an index template.
sourcepub fn get_mapping<'b>(
&'a self,
parts: IndicesGetMappingParts<'b>
) -> IndicesGetMapping<'a, 'b>
pub fn get_mapping<'b>(
&'a self,
parts: IndicesGetMappingParts<'b>
) -> IndicesGetMapping<'a, 'b>
Returns mappings for one or more indices.
sourcepub fn get_settings<'b>(
&'a self,
parts: IndicesGetSettingsParts<'b>
) -> IndicesGetSettings<'a, 'b>
pub fn get_settings<'b>(
&'a self,
parts: IndicesGetSettingsParts<'b>
) -> IndicesGetSettings<'a, 'b>
Returns settings for one or more indices.
sourcepub fn get_template<'b>(
&'a self,
parts: IndicesGetTemplateParts<'b>
) -> IndicesGetTemplate<'a, 'b>
pub fn get_template<'b>(
&'a self,
parts: IndicesGetTemplateParts<'b>
) -> IndicesGetTemplate<'a, 'b>
Returns an index template.
sourcepub fn get_upgrade<'b>(
&'a self,
parts: IndicesGetUpgradeParts<'b>
) -> IndicesGetUpgrade<'a, 'b>
pub fn get_upgrade<'b>(
&'a self,
parts: IndicesGetUpgradeParts<'b>
) -> IndicesGetUpgrade<'a, 'b>
DEPRECATED Returns a progress status of current upgrade.
sourcepub fn migrate_to_data_stream<'b>(
&'a self,
parts: IndicesMigrateToDataStreamParts<'b>
) -> IndicesMigrateToDataStream<'a, 'b, ()>
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
sourcepub fn open<'b>(
&'a self,
parts: IndicesOpenParts<'b>
) -> IndicesOpen<'a, 'b, ()>
pub fn open<'b>(
&'a self,
parts: IndicesOpenParts<'b>
) -> IndicesOpen<'a, 'b, ()>
Opens an index.
sourcepub fn promote_data_stream<'b>(
&'a self,
parts: IndicesPromoteDataStreamParts<'b>
) -> IndicesPromoteDataStream<'a, 'b, ()>
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
sourcepub fn put_alias<'b>(
&'a self,
parts: IndicesPutAliasParts<'b>
) -> IndicesPutAlias<'a, 'b, ()>
pub fn put_alias<'b>(
&'a self,
parts: IndicesPutAliasParts<'b>
) -> IndicesPutAlias<'a, 'b, ()>
Creates or updates an alias.
sourcepub fn put_index_template<'b>(
&'a self,
parts: IndicesPutIndexTemplateParts<'b>
) -> IndicesPutIndexTemplate<'a, 'b, ()>
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.
sourcepub fn put_mapping<'b>(
&'a self,
parts: IndicesPutMappingParts<'b>
) -> IndicesPutMapping<'a, 'b, ()>
pub fn put_mapping<'b>(
&'a self,
parts: IndicesPutMappingParts<'b>
) -> IndicesPutMapping<'a, 'b, ()>
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?;
sourcepub fn put_settings<'b>(
&'a self,
parts: IndicesPutSettingsParts<'b>
) -> IndicesPutSettings<'a, 'b, ()>
pub fn put_settings<'b>(
&'a self,
parts: IndicesPutSettingsParts<'b>
) -> IndicesPutSettings<'a, 'b, ()>
Updates the index settings.
sourcepub fn put_template<'b>(
&'a self,
parts: IndicesPutTemplateParts<'b>
) -> IndicesPutTemplate<'a, 'b, ()>
pub fn put_template<'b>(
&'a self,
parts: IndicesPutTemplateParts<'b>
) -> IndicesPutTemplate<'a, 'b, ()>
Creates or updates an index template.
sourcepub fn recovery<'b>(
&'a self,
parts: IndicesRecoveryParts<'b>
) -> IndicesRecovery<'a, 'b>
pub fn recovery<'b>(
&'a self,
parts: IndicesRecoveryParts<'b>
) -> IndicesRecovery<'a, 'b>
Returns information about ongoing index shard recoveries.
sourcepub fn refresh<'b>(
&'a self,
parts: IndicesRefreshParts<'b>
) -> IndicesRefresh<'a, 'b, ()>
pub fn refresh<'b>(
&'a self,
parts: IndicesRefreshParts<'b>
) -> IndicesRefresh<'a, 'b, ()>
Performs the refresh operation in one or more indices.
sourcepub fn reload_search_analyzers<'b>(
&'a self,
parts: IndicesReloadSearchAnalyzersParts<'b>
) -> IndicesReloadSearchAnalyzers<'a, 'b, ()>
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.
sourcepub fn rollover<'b>(
&'a self,
parts: IndicesRolloverParts<'b>
) -> IndicesRollover<'a, 'b, ()>
pub fn rollover<'b>(
&'a self,
parts: IndicesRolloverParts<'b>
) -> IndicesRollover<'a, 'b, ()>
Updates an alias to point to a new index when the existing index is considered to be too large or too old.
sourcepub fn segments<'b>(
&'a self,
parts: IndicesSegmentsParts<'b>
) -> IndicesSegments<'a, 'b>
pub fn segments<'b>(
&'a self,
parts: IndicesSegmentsParts<'b>
) -> IndicesSegments<'a, 'b>
Provides low-level information about segments in a Lucene index.
sourcepub fn shard_stores<'b>(
&'a self,
parts: IndicesShardStoresParts<'b>
) -> IndicesShardStores<'a, 'b>
pub fn shard_stores<'b>(
&'a self,
parts: IndicesShardStoresParts<'b>
) -> IndicesShardStores<'a, 'b>
Provides store information for shard copies of indices.
sourcepub fn shrink<'b>(
&'a self,
parts: IndicesShrinkParts<'b>
) -> IndicesShrink<'a, 'b, ()>
pub fn shrink<'b>(
&'a self,
parts: IndicesShrinkParts<'b>
) -> IndicesShrink<'a, 'b, ()>
Allow to shrink an existing index into a new index with fewer primary shards.
sourcepub fn simulate_index_template<'b>(
&'a self,
parts: IndicesSimulateIndexTemplateParts<'b>
) -> IndicesSimulateIndexTemplate<'a, 'b, ()>
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
sourcepub fn simulate_template<'b>(
&'a self,
parts: IndicesSimulateTemplateParts<'b>
) -> IndicesSimulateTemplate<'a, 'b, ()>
pub fn simulate_template<'b>(
&'a self,
parts: IndicesSimulateTemplateParts<'b>
) -> IndicesSimulateTemplate<'a, 'b, ()>
Simulate resolving the given template name or body
sourcepub fn split<'b>(
&'a self,
parts: IndicesSplitParts<'b>
) -> IndicesSplit<'a, 'b, ()>
pub fn split<'b>(
&'a self,
parts: IndicesSplitParts<'b>
) -> IndicesSplit<'a, 'b, ()>
Allows you to split an existing index into a new index with more primary shards.
sourcepub fn stats<'b>(&'a self, parts: IndicesStatsParts<'b>) -> IndicesStats<'a, 'b>
pub fn stats<'b>(&'a self, parts: IndicesStatsParts<'b>) -> IndicesStats<'a, 'b>
Provides statistics on operations happening in an index.
sourcepub fn unfreeze<'b>(
&'a self,
parts: IndicesUnfreezeParts<'b>
) -> IndicesUnfreeze<'a, 'b, ()>
pub fn unfreeze<'b>(
&'a self,
parts: IndicesUnfreezeParts<'b>
) -> IndicesUnfreeze<'a, 'b, ()>
Unfreezes an index. When a frozen index is unfrozen, the index goes through the normal recovery process and becomes writeable again.
sourcepub fn update_aliases<'b>(&'a self) -> IndicesUpdateAliases<'a, 'b, ()>
pub fn update_aliases<'b>(&'a self) -> IndicesUpdateAliases<'a, 'b, ()>
Updates index aliases.
sourcepub fn upgrade<'b>(
&'a self,
parts: IndicesUpgradeParts<'b>
) -> IndicesUpgrade<'a, 'b, ()>
pub fn upgrade<'b>(
&'a self,
parts: IndicesUpgradeParts<'b>
) -> IndicesUpgrade<'a, 'b, ()>
DEPRECATED Upgrades to the current version of Lucene.
sourcepub fn validate_query<'b>(
&'a self,
parts: IndicesValidateQueryParts<'b>
) -> IndicesValidateQuery<'a, 'b, ()>
pub fn validate_query<'b>(
&'a self,
parts: IndicesValidateQueryParts<'b>
) -> IndicesValidateQuery<'a, 'b, ()>
Allows a user to validate a potentially expensive query without executing it.
Auto Trait Implementations
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
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