pub struct Indices<'a> { /* private fields */ }
Expand description
Namespace client for Indices APIs
Implementations§
Source§impl<'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 = OpenSearch::default();
let response = client
.indices()
.create(IndicesCreateParts::Index("test_index"))
.body(json!({
"mappings" : {
"properties" : {
"field1" : { "type" : "text" }
}
}
}))
.send()
.await?;
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 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_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 = OpenSearch::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 resolve_index<'b>(
&'a self,
parts: IndicesResolveIndexParts<'b>,
) -> IndicesResolveIndex<'a, 'b>
pub fn resolve_index<'b>( &'a self, parts: IndicesResolveIndexParts<'b>, ) -> IndicesResolveIndex<'a, 'b>
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.
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.