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 disk_usage<'b>(
&'a self,
parts: IndicesDiskUsageParts<'b>
) -> IndicesDiskUsage<'a, 'b, ()>
pub fn disk_usage<'b>(
&'a self,
parts: IndicesDiskUsageParts<'b>
) -> IndicesDiskUsage<'a, 'b, ()>
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.
sourcepub fn downsample<'b>(
&'a self,
parts: IndicesDownsampleParts<'b>
) -> IndicesDownsample<'a, 'b, ()>
pub fn downsample<'b>(
&'a self,
parts: IndicesDownsampleParts<'b>
) -> IndicesDownsample<'a, 'b, ()>
Downsample an index
Optional, experimental
This requires the experimental-apis
feature. Can have breaking changes in future
versions or might even be removed entirely.
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 field_usage_stats<'b>(
&'a self,
parts: IndicesFieldUsageStatsParts<'b>
) -> IndicesFieldUsageStats<'a, 'b>
pub fn field_usage_stats<'b>(
&'a self,
parts: IndicesFieldUsageStatsParts<'b>
) -> IndicesFieldUsageStats<'a, 'b>
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.
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 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_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 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 modify_data_stream<'b>(&'a self) -> IndicesModifyDataStream<'a, 'b, ()>
pub fn modify_data_stream<'b>(&'a self) -> IndicesModifyDataStream<'a, 'b, ()>
Indices Modify Data Stream API
Modifies 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 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
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 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.