[[reference-indices]] == client.indices //////// =========================================================================================================================== || || || || || || || ██████╗ ███████╗ █████╗ ██████╗ ███╗ ███╗███████╗ || || ██╔══██╗██╔════╝██╔══██╗██╔══██╗████╗ ████║██╔════╝ || || ██████╔╝█████╗ ███████║██║ ██║██╔████╔██║█████╗ || || ██╔══██╗██╔══╝ ██╔══██║██║ ██║██║╚██╔╝██║██╔══╝ || || ██║ ██║███████╗██║ ██║██████╔╝██║ ╚═╝ ██║███████╗ || || ╚═╝ ╚═╝╚══════╝╚═╝ ╚═╝╚═════╝ ╚═╝ ╚═╝╚══════╝ || || || || || || This file is autogenerated, DO NOT send pull requests that changes this file directly. || || You should update the script that does the generation, which can be found in: || || https://github.com/elastic/elastic-client-generator-js || || || || You can run the script with the following command: || || npm run elasticsearch -- --version || || || || || || || =========================================================================================================================== //////// ++++ ++++ [discrete] [[client.indices.addBlock]] == `client.indices.addBlock()` Add an index block. Limits the operations allowed on an index by blocking specific operation types. {ref}/index-modules-blocks.html[{es} documentation] [discrete] === Function signature [source,ts] ---- (request: IndicesAddBlockRequest, options?: TransportRequestOptions) => Promise ---- [discrete] === Request [source,ts,subs=+macros] ---- interface IndicesAddBlockRequest extends <> { index: <> block: IndicesAddBlockIndicesBlockOptions allow_no_indices?: boolean expand_wildcards?: <> ignore_unavailable?: boolean master_timeout?: <> timeout?: <> } ---- [discrete] === Response [source,ts,subs=+macros] ---- interface IndicesAddBlockResponse { acknowledged: boolean shards_acknowledged: boolean indices: IndicesAddBlockIndicesBlockStatus[] } ---- [discrete] [[client.indices.analyze]] == `client.indices.analyze()` Get tokens from text analysis. The analyze API performs [analysis](https://www.elastic.co/guide/en/elasticsearch/reference/current/analysis.html) on a text string and returns the resulting tokens. {ref}/indices-analyze.html[{es} documentation] [discrete] === Function signature [source,ts] ---- (request: IndicesAnalyzeRequest, options?: TransportRequestOptions) => Promise ---- [discrete] === Request [source,ts,subs=+macros] ---- interface IndicesAnalyzeRequest extends <> { index?: <> analyzer?: string attributes?: string[] char_filter?: <>[] explain?: boolean field?: <> filter?: <>[] normalizer?: string text?: IndicesAnalyzeTextToAnalyze tokenizer?: <> } ---- [discrete] === Response [source,ts,subs=+macros] ---- interface IndicesAnalyzeResponse { detail?: IndicesAnalyzeAnalyzeDetail tokens?: IndicesAnalyzeAnalyzeToken[] } ---- [discrete] [[client.indices.clearCache]] == `client.indices.clearCache()` Clears the caches of one or more indices. For data streams, the API clears the caches of the stream’s backing indices. {ref}/indices-clearcache.html[{es} documentation] [discrete] === Function signature [source,ts] ---- (request: IndicesClearCacheRequest, options?: TransportRequestOptions) => Promise ---- [discrete] === Request [source,ts,subs=+macros] ---- interface IndicesClearCacheRequest extends <> { index?: <> allow_no_indices?: boolean expand_wildcards?: <> fielddata?: boolean fields?: <> ignore_unavailable?: boolean query?: boolean request?: boolean } ---- [discrete] === Response [source,ts,subs=+macros] ---- type IndicesClearCacheResponse = <> ---- [discrete] [[client.indices.clone]] == `client.indices.clone()` Clones an existing index. {ref}/indices-clone-index.html[{es} documentation] [discrete] === Function signature [source,ts] ---- (request: IndicesCloneRequest, options?: TransportRequestOptions) => Promise ---- [discrete] === Request [source,ts,subs=+macros] ---- interface IndicesCloneRequest extends <> { index: <> target: <> master_timeout?: <> timeout?: <> wait_for_active_shards?: <> aliases?: Record<<>, <>> settings?: Record } ---- [discrete] === Response [source,ts,subs=+macros] ---- interface IndicesCloneResponse { acknowledged: boolean index: <> shards_acknowledged: boolean } ---- [discrete] [[client.indices.close]] == `client.indices.close()` Closes an index. {ref}/indices-close.html[{es} documentation] [discrete] === Function signature [source,ts] ---- (request: IndicesCloseRequest, options?: TransportRequestOptions) => Promise ---- [discrete] === Request [source,ts,subs=+macros] ---- interface IndicesCloseRequest extends <> { index: <> allow_no_indices?: boolean expand_wildcards?: <> ignore_unavailable?: boolean master_timeout?: <> timeout?: <> wait_for_active_shards?: <> } ---- [discrete] === Response [source,ts,subs=+macros] ---- interface IndicesCloseResponse { acknowledged: boolean indices: Record<<>, IndicesCloseCloseIndexResult> shards_acknowledged: boolean } ---- [discrete] [[client.indices.create]] == `client.indices.create()` Create an index. Creates a new index. {ref}/indices-create-index.html[{es} documentation] [discrete] === Function signature [source,ts] ---- (request: IndicesCreateRequest, options?: TransportRequestOptions) => Promise ---- [discrete] === Request [source,ts,subs=+macros] ---- interface IndicesCreateRequest extends <> { index: <> master_timeout?: <> timeout?: <> wait_for_active_shards?: <> aliases?: Record<<>, <>> mappings?: <> settings?: <> } ---- [discrete] === Response [source,ts,subs=+macros] ---- interface IndicesCreateResponse { index: <> shards_acknowledged: boolean acknowledged: boolean } ---- [discrete] [[client.indices.createDataStream]] == `client.indices.createDataStream()` Create a data stream. Creates a data stream. You must have a matching index template with data stream enabled. {ref}/data-streams.html[{es} documentation] [discrete] === Function signature [source,ts] ---- (request: IndicesCreateDataStreamRequest, options?: TransportRequestOptions) => Promise ---- [discrete] === Request [source,ts,subs=+macros] ---- interface IndicesCreateDataStreamRequest extends <> { name: <> master_timeout?: <> timeout?: <> } ---- [discrete] === Response [source,ts,subs=+macros] ---- type IndicesCreateDataStreamResponse = <> ---- [discrete] [[client.indices.dataStreamsStats]] == `client.indices.dataStreamsStats()` Get data stream stats. Retrieves statistics for one or more data streams. {ref}/data-streams.html[{es} documentation] [discrete] === Function signature [source,ts] ---- (request: IndicesDataStreamsStatsRequest, options?: TransportRequestOptions) => Promise ---- [discrete] === Request [source,ts,subs=+macros] ---- interface IndicesDataStreamsStatsRequest extends <> { name?: <> expand_wildcards?: <> } ---- [discrete] === Response [source,ts,subs=+macros] ---- interface IndicesDataStreamsStatsResponse { _shards: <> backing_indices: <> data_stream_count: <> data_streams: IndicesDataStreamsStatsDataStreamsStatsItem[] total_store_sizes?: <> total_store_size_bytes: <> } ---- [discrete] [[client.indices.delete]] == `client.indices.delete()` Delete indices. Deletes one or more indices. {ref}/indices-delete-index.html[{es} documentation] [discrete] === Function signature [source,ts] ---- (request: IndicesDeleteRequest, options?: TransportRequestOptions) => Promise ---- [discrete] === Request [source,ts,subs=+macros] ---- interface IndicesDeleteRequest extends <> { index: <> allow_no_indices?: boolean expand_wildcards?: <> ignore_unavailable?: boolean master_timeout?: <> timeout?: <> } ---- [discrete] === Response [source,ts,subs=+macros] ---- type IndicesDeleteResponse = <> ---- [discrete] [[client.indices.deleteAlias]] == `client.indices.deleteAlias()` Delete an alias. Removes a data stream or index from an alias. {ref}/indices-aliases.html[{es} documentation] [discrete] === Function signature [source,ts] ---- (request: IndicesDeleteAliasRequest, options?: TransportRequestOptions) => Promise ---- [discrete] === Request [source,ts,subs=+macros] ---- interface IndicesDeleteAliasRequest extends <> { index: <> name: <> master_timeout?: <> timeout?: <> } ---- [discrete] === Response [source,ts,subs=+macros] ---- type IndicesDeleteAliasResponse = <> ---- [discrete] [[client.indices.deleteDataLifecycle]] == `client.indices.deleteDataLifecycle()` Delete data stream lifecycles. Removes the data stream lifecycle from a data stream, rendering it not managed by the data stream lifecycle. {ref}/data-streams-delete-lifecycle.html[{es} documentation] [discrete] === Function signature [source,ts] ---- (request: IndicesDeleteDataLifecycleRequest, options?: TransportRequestOptions) => Promise ---- [discrete] === Request [source,ts,subs=+macros] ---- interface IndicesDeleteDataLifecycleRequest extends <> { name: <> expand_wildcards?: <> master_timeout?: <> timeout?: <> } ---- [discrete] === Response [source,ts,subs=+macros] ---- type IndicesDeleteDataLifecycleResponse = <> ---- [discrete] [[client.indices.deleteDataStream]] == `client.indices.deleteDataStream()` Delete data streams. Deletes one or more data streams and their backing indices. {ref}/data-streams.html[{es} documentation] [discrete] === Function signature [source,ts] ---- (request: IndicesDeleteDataStreamRequest, options?: TransportRequestOptions) => Promise ---- [discrete] === Request [source,ts,subs=+macros] ---- interface IndicesDeleteDataStreamRequest extends <> { name: <> master_timeout?: <> expand_wildcards?: <> } ---- [discrete] === Response [source,ts,subs=+macros] ---- type IndicesDeleteDataStreamResponse = <> ---- [discrete] [[client.indices.deleteIndexTemplate]] == `client.indices.deleteIndexTemplate()` Delete an index template. The provided may contain multiple template names separated by a comma. If multiple template names are specified then there is no wildcard support and the provided names should match completely with existing templates. {ref}/indices-delete-template.html[{es} documentation] [discrete] === Function signature [source,ts] ---- (request: IndicesDeleteIndexTemplateRequest, options?: TransportRequestOptions) => Promise ---- [discrete] === Request [source,ts,subs=+macros] ---- interface IndicesDeleteIndexTemplateRequest extends <> { name: <> master_timeout?: <> timeout?: <> } ---- [discrete] === Response [source,ts,subs=+macros] ---- type IndicesDeleteIndexTemplateResponse = <> ---- [discrete] [[client.indices.deleteTemplate]] == `client.indices.deleteTemplate()` Deletes a legacy index template. {ref}/indices-delete-template-v1.html[{es} documentation] [discrete] === Function signature [source,ts] ---- (request: IndicesDeleteTemplateRequest, options?: TransportRequestOptions) => Promise ---- [discrete] === Request [source,ts,subs=+macros] ---- interface IndicesDeleteTemplateRequest extends <> { name: <> master_timeout?: <> timeout?: <> } ---- [discrete] === Response [source,ts,subs=+macros] ---- type IndicesDeleteTemplateResponse = <> ---- [discrete] [[client.indices.diskUsage]] == `client.indices.diskUsage()` Analyzes the disk usage of each field of an index or data stream. {ref}/indices-disk-usage.html[{es} documentation] [discrete] === Function signature [source,ts] ---- (request: IndicesDiskUsageRequest, options?: TransportRequestOptions) => Promise ---- [discrete] === Request [source,ts,subs=+macros] ---- interface IndicesDiskUsageRequest extends <> { index: <> allow_no_indices?: boolean expand_wildcards?: <> flush?: boolean ignore_unavailable?: boolean run_expensive_tasks?: boolean } ---- [discrete] === Response [source,ts,subs=+macros] ---- type IndicesDiskUsageResponse = any ---- [discrete] [[client.indices.downsample]] == `client.indices.downsample()` Aggregates a time series (TSDS) index and stores pre-computed statistical summaries (`min`, `max`, `sum`, `value_count` and `avg`) for each metric field grouped by a configured time interval. {ref}/indices-downsample-data-stream.html[{es} documentation] [discrete] === Function signature [source,ts] ---- (request: IndicesDownsampleRequest, options?: TransportRequestOptions) => Promise ---- [discrete] === Request [source,ts,subs=+macros] ---- interface IndicesDownsampleRequest extends <> { index: <> target_index: <> config?: <> } ---- [discrete] === Response [source,ts,subs=+macros] ---- type IndicesDownsampleResponse = any ---- [discrete] [[client.indices.exists]] == `client.indices.exists()` Check indices. Checks if one or more indices, index aliases, or data streams exist. {ref}/indices-exists.html[{es} documentation] [discrete] === Function signature [source,ts] ---- (request: IndicesExistsRequest, options?: TransportRequestOptions) => Promise ---- [discrete] === Request [source,ts,subs=+macros] ---- interface IndicesExistsRequest extends <> { index: <> allow_no_indices?: boolean expand_wildcards?: <> flat_settings?: boolean ignore_unavailable?: boolean include_defaults?: boolean local?: boolean } ---- [discrete] === Response [source,ts,subs=+macros] ---- type IndicesExistsResponse = boolean ---- [discrete] [[client.indices.existsAlias]] == `client.indices.existsAlias()` Check aliases. Checks if one or more data stream or index aliases exist. {ref}/indices-aliases.html[{es} documentation] [discrete] === Function signature [source,ts] ---- (request: IndicesExistsAliasRequest, options?: TransportRequestOptions) => Promise ---- [discrete] === Request [source,ts,subs=+macros] ---- interface IndicesExistsAliasRequest extends <> { name: <> index?: <> allow_no_indices?: boolean expand_wildcards?: <> ignore_unavailable?: boolean master_timeout?: <> } ---- [discrete] === Response [source,ts,subs=+macros] ---- type IndicesExistsAliasResponse = boolean ---- [discrete] [[client.indices.existsIndexTemplate]] == `client.indices.existsIndexTemplate()` Check index templates. Check whether index templates exist. {ref}/index-templates.html[{es} documentation] [discrete] === Function signature [source,ts] ---- (request: IndicesExistsIndexTemplateRequest, options?: TransportRequestOptions) => Promise ---- [discrete] === Request [source,ts,subs=+macros] ---- interface IndicesExistsIndexTemplateRequest extends <> { name: <> master_timeout?: <> } ---- [discrete] === Response [source,ts,subs=+macros] ---- type IndicesExistsIndexTemplateResponse = boolean ---- [discrete] [[client.indices.existsTemplate]] == `client.indices.existsTemplate()` Check existence of index templates. Returns information about whether a particular index template exists. {ref}/indices-template-exists-v1.html[{es} documentation] [discrete] === Function signature [source,ts] ---- (request: IndicesExistsTemplateRequest, options?: TransportRequestOptions) => Promise ---- [discrete] === Request [source,ts,subs=+macros] ---- interface IndicesExistsTemplateRequest extends <> { name: <> flat_settings?: boolean local?: boolean master_timeout?: <> } ---- [discrete] === Response [source,ts,subs=+macros] ---- type IndicesExistsTemplateResponse = boolean ---- [discrete] [[client.indices.explainDataLifecycle]] == `client.indices.explainDataLifecycle()` Get the status for a data stream lifecycle. Retrieves information about an index or data stream’s current data stream lifecycle status, such as time since index creation, time since rollover, the lifecycle configuration managing the index, or any errors encountered during lifecycle execution. {ref}/data-streams-explain-lifecycle.html[{es} documentation] [discrete] === Function signature [source,ts] ---- (request: IndicesExplainDataLifecycleRequest, options?: TransportRequestOptions) => Promise ---- [discrete] === Request [source,ts,subs=+macros] ---- interface IndicesExplainDataLifecycleRequest extends <> { index: <> include_defaults?: boolean master_timeout?: <> } ---- [discrete] === Response [source,ts,subs=+macros] ---- interface IndicesExplainDataLifecycleResponse { indices: Record<<>, IndicesExplainDataLifecycleDataStreamLifecycleExplain> } ---- [discrete] [[client.indices.fieldUsageStats]] == `client.indices.fieldUsageStats()` Returns field usage information for each shard and field of an index. {ref}/field-usage-stats.html[{es} documentation] [discrete] === Function signature [source,ts] ---- (request: IndicesFieldUsageStatsRequest, options?: TransportRequestOptions) => Promise ---- [discrete] === Request [source,ts,subs=+macros] ---- interface IndicesFieldUsageStatsRequest extends <> { index: <> allow_no_indices?: boolean expand_wildcards?: <> ignore_unavailable?: boolean fields?: <> master_timeout?: <> timeout?: <> wait_for_active_shards?: <> } ---- [discrete] === Response [source,ts,subs=+macros] ---- type IndicesFieldUsageStatsResponse = IndicesFieldUsageStatsFieldsUsageBody ---- [discrete] [[client.indices.flush]] == `client.indices.flush()` Flushes one or more data streams or indices. {ref}/indices-flush.html[{es} documentation] [discrete] === Function signature [source,ts] ---- (request: IndicesFlushRequest, options?: TransportRequestOptions) => Promise ---- [discrete] === Request [source,ts,subs=+macros] ---- interface IndicesFlushRequest extends <> { index?: <> allow_no_indices?: boolean expand_wildcards?: <> force?: boolean ignore_unavailable?: boolean wait_if_ongoing?: boolean } ---- [discrete] === Response [source,ts,subs=+macros] ---- type IndicesFlushResponse = <> ---- [discrete] [[client.indices.forcemerge]] == `client.indices.forcemerge()` Performs the force merge operation on one or more indices. {ref}/indices-forcemerge.html[{es} documentation] [discrete] === Function signature [source,ts] ---- (request: IndicesForcemergeRequest, options?: TransportRequestOptions) => Promise ---- [discrete] === Request [source,ts,subs=+macros] ---- interface IndicesForcemergeRequest extends <> { index?: <> allow_no_indices?: boolean expand_wildcards?: <> flush?: boolean ignore_unavailable?: boolean max_num_segments?: <> only_expunge_deletes?: boolean wait_for_completion?: boolean } ---- [discrete] === Response [source,ts,subs=+macros] ---- type IndicesForcemergeResponse = IndicesForcemergeForceMergeResponseBody ---- [discrete] [[client.indices.get]] == `client.indices.get()` Get index information. Returns information about one or more indices. For data streams, the API returns information about the stream’s backing indices. {ref}/indices-get-index.html[{es} documentation] [discrete] === Function signature [source,ts] ---- (request: IndicesGetRequest, options?: TransportRequestOptions) => Promise ---- [discrete] === Request [source,ts,subs=+macros] ---- interface IndicesGetRequest extends <> { index: <> allow_no_indices?: boolean expand_wildcards?: <> flat_settings?: boolean ignore_unavailable?: boolean include_defaults?: boolean local?: boolean master_timeout?: <> features?: IndicesGetFeatures } ---- [discrete] === Response [source,ts,subs=+macros] ---- type IndicesGetResponse = Record<<>, <>> ---- [discrete] [[client.indices.getAlias]] == `client.indices.getAlias()` Get aliases. Retrieves information for one or more data stream or index aliases. {ref}/indices-aliases.html[{es} documentation] [discrete] === Function signature [source,ts] ---- (request: IndicesGetAliasRequest, options?: TransportRequestOptions) => Promise ---- [discrete] === Request [source,ts,subs=+macros] ---- interface IndicesGetAliasRequest extends <> { name?: <> index?: <> allow_no_indices?: boolean expand_wildcards?: <> ignore_unavailable?: boolean master_timeout?: <> } ---- [discrete] === Response [source,ts,subs=+macros] ---- type IndicesGetAliasResponse = Record<<>, IndicesGetAliasIndexAliases> ---- [discrete] [[client.indices.getDataLifecycle]] == `client.indices.getDataLifecycle()` Get data stream lifecycles. Retrieves the data stream lifecycle configuration of one or more data streams. {ref}/data-streams-get-lifecycle.html[{es} documentation] [discrete] === Function signature [source,ts] ---- (request: IndicesGetDataLifecycleRequest, options?: TransportRequestOptions) => Promise ---- [discrete] === Request [source,ts,subs=+macros] ---- interface IndicesGetDataLifecycleRequest extends <> { name: <> expand_wildcards?: <> include_defaults?: boolean master_timeout?: <> } ---- [discrete] === Response [source,ts,subs=+macros] ---- interface IndicesGetDataLifecycleResponse { data_streams: IndicesGetDataLifecycleDataStreamWithLifecycle[] } ---- [discrete] [[client.indices.getDataStream]] == `client.indices.getDataStream()` Get data streams. Retrieves information about one or more data streams. {ref}/data-streams.html[{es} documentation] [discrete] === Function signature [source,ts] ---- (request: IndicesGetDataStreamRequest, options?: TransportRequestOptions) => Promise ---- [discrete] === Request [source,ts,subs=+macros] ---- interface IndicesGetDataStreamRequest extends <> { name?: <> expand_wildcards?: <> include_defaults?: boolean master_timeout?: <> verbose?: boolean } ---- [discrete] === Response [source,ts,subs=+macros] ---- interface IndicesGetDataStreamResponse { data_streams: <>[] } ---- [discrete] [[client.indices.getFieldMapping]] == `client.indices.getFieldMapping()` Get mapping definitions. Retrieves mapping definitions for one or more fields. For data streams, the API retrieves field mappings for the stream’s backing indices. {ref}/indices-get-field-mapping.html[{es} documentation] [discrete] === Function signature [source,ts] ---- (request: IndicesGetFieldMappingRequest, options?: TransportRequestOptions) => Promise ---- [discrete] === Request [source,ts,subs=+macros] ---- interface IndicesGetFieldMappingRequest extends <> { fields: <> index?: <> allow_no_indices?: boolean expand_wildcards?: <> ignore_unavailable?: boolean include_defaults?: boolean local?: boolean } ---- [discrete] === Response [source,ts,subs=+macros] ---- type IndicesGetFieldMappingResponse = Record<<>, IndicesGetFieldMappingTypeFieldMappings> ---- [discrete] [[client.indices.getIndexTemplate]] == `client.indices.getIndexTemplate()` Get index templates. Returns information about one or more index templates. {ref}/indices-get-template.html[{es} documentation] [discrete] === Function signature [source,ts] ---- (request: IndicesGetIndexTemplateRequest, options?: TransportRequestOptions) => Promise ---- [discrete] === Request [source,ts,subs=+macros] ---- interface IndicesGetIndexTemplateRequest extends <> { name?: <> local?: boolean flat_settings?: boolean master_timeout?: <> include_defaults?: boolean } ---- [discrete] === Response [source,ts,subs=+macros] ---- interface IndicesGetIndexTemplateResponse { index_templates: IndicesGetIndexTemplateIndexTemplateItem[] } ---- [discrete] [[client.indices.getMapping]] == `client.indices.getMapping()` Get mapping definitions. Retrieves mapping definitions for one or more indices. For data streams, the API retrieves mappings for the stream’s backing indices. {ref}/indices-get-mapping.html[{es} documentation] [discrete] === Function signature [source,ts] ---- (request: IndicesGetMappingRequest, options?: TransportRequestOptions) => Promise ---- [discrete] === Request [source,ts,subs=+macros] ---- interface IndicesGetMappingRequest extends <> { index?: <> allow_no_indices?: boolean expand_wildcards?: <> ignore_unavailable?: boolean local?: boolean master_timeout?: <> } ---- [discrete] === Response [source,ts,subs=+macros] ---- type IndicesGetMappingResponse = Record<<>, IndicesGetMappingIndexMappingRecord> ---- [discrete] [[client.indices.getSettings]] == `client.indices.getSettings()` Get index settings. Returns setting information for one or more indices. For data streams, returns setting information for the stream’s backing indices. {ref}/indices-get-settings.html[{es} documentation] [discrete] === Function signature [source,ts] ---- (request: IndicesGetSettingsRequest, options?: TransportRequestOptions) => Promise ---- [discrete] === Request [source,ts,subs=+macros] ---- interface IndicesGetSettingsRequest extends <> { index?: <> name?: <> allow_no_indices?: boolean expand_wildcards?: <> flat_settings?: boolean ignore_unavailable?: boolean include_defaults?: boolean local?: boolean master_timeout?: <> } ---- [discrete] === Response [source,ts,subs=+macros] ---- type IndicesGetSettingsResponse = Record<<>, <>> ---- [discrete] [[client.indices.getTemplate]] == `client.indices.getTemplate()` Get index templates. Retrieves information about one or more index templates. {ref}/indices-get-template-v1.html[{es} documentation] [discrete] === Function signature [source,ts] ---- (request: IndicesGetTemplateRequest, options?: TransportRequestOptions) => Promise ---- [discrete] === Request [source,ts,subs=+macros] ---- interface IndicesGetTemplateRequest extends <> { name?: <> flat_settings?: boolean local?: boolean master_timeout?: <> } ---- [discrete] === Response [source,ts,subs=+macros] ---- type IndicesGetTemplateResponse = Record>> ---- [discrete] [[client.indices.migrateToDataStream]] == `client.indices.migrateToDataStream()` Convert an index alias to a data stream. Converts an index alias to a data stream. You must have a matching index template that is data stream enabled. The alias must meet the following criteria: The alias must have a write index; All indices for the alias must have a `@timestamp` field mapping of a `date` or `date_nanos` field type; The alias must not have any filters; The alias must not use custom routing. If successful, the request removes the alias and creates a data stream with the same name. The indices for the alias become hidden backing indices for the stream. The write index for the alias becomes the write index for the stream. {ref}/data-streams.html[{es} documentation] [discrete] === Function signature [source,ts] ---- (request: IndicesMigrateToDataStreamRequest, options?: TransportRequestOptions) => Promise ---- [discrete] === Request [source,ts,subs=+macros] ---- interface IndicesMigrateToDataStreamRequest extends <> { name: <> master_timeout?: <> timeout?: <> } ---- [discrete] === Response [source,ts,subs=+macros] ---- type IndicesMigrateToDataStreamResponse = <> ---- [discrete] [[client.indices.modifyDataStream]] == `client.indices.modifyDataStream()` Update data streams. Performs one or more data stream modification actions in a single atomic operation. {ref}/data-streams.html[{es} documentation] [discrete] === Function signature [source,ts] ---- (request: IndicesModifyDataStreamRequest, options?: TransportRequestOptions) => Promise ---- [discrete] === Request [source,ts,subs=+macros] ---- interface IndicesModifyDataStreamRequest extends <> { actions: IndicesModifyDataStreamAction[] } ---- [discrete] === Response [source,ts,subs=+macros] ---- type IndicesModifyDataStreamResponse = <> ---- [discrete] [[client.indices.open]] == `client.indices.open()` Opens a closed index. For data streams, the API opens any closed backing indices. {ref}/indices-open-close.html[{es} documentation] [discrete] === Function signature [source,ts] ---- (request: IndicesOpenRequest, options?: TransportRequestOptions) => Promise ---- [discrete] === Request [source,ts,subs=+macros] ---- interface IndicesOpenRequest extends <> { index: <> allow_no_indices?: boolean expand_wildcards?: <> ignore_unavailable?: boolean master_timeout?: <> timeout?: <> wait_for_active_shards?: <> } ---- [discrete] === Response [source,ts,subs=+macros] ---- interface IndicesOpenResponse { acknowledged: boolean shards_acknowledged: boolean } ---- [discrete] [[client.indices.promoteDataStream]] == `client.indices.promoteDataStream()` Promotes a data stream from a replicated data stream managed by CCR to a regular data stream {ref}/data-streams.html[{es} documentation] [discrete] === Function signature [source,ts] ---- (request: IndicesPromoteDataStreamRequest, options?: TransportRequestOptions) => Promise ---- [discrete] === Request [source,ts,subs=+macros] ---- interface IndicesPromoteDataStreamRequest extends <> { name: <> master_timeout?: <> } ---- [discrete] === Response [source,ts,subs=+macros] ---- type IndicesPromoteDataStreamResponse = any ---- [discrete] [[client.indices.putAlias]] == `client.indices.putAlias()` Create or update an alias. Adds a data stream or index to an alias. {ref}/indices-aliases.html[{es} documentation] [discrete] === Function signature [source,ts] ---- (request: IndicesPutAliasRequest, options?: TransportRequestOptions) => Promise ---- [discrete] === Request [source,ts,subs=+macros] ---- interface IndicesPutAliasRequest extends <> { index: <> name: <> master_timeout?: <> timeout?: <> filter?: <> index_routing?: <> is_write_index?: boolean routing?: <> search_routing?: <> } ---- [discrete] === Response [source,ts,subs=+macros] ---- type IndicesPutAliasResponse = <> ---- [discrete] [[client.indices.putDataLifecycle]] == `client.indices.putDataLifecycle()` Update data stream lifecycles. Update the data stream lifecycle of the specified data streams. {ref}/data-streams-put-lifecycle.html[{es} documentation] [discrete] === Function signature [source,ts] ---- (request: IndicesPutDataLifecycleRequest, options?: TransportRequestOptions) => Promise ---- [discrete] === Request [source,ts,subs=+macros] ---- interface IndicesPutDataLifecycleRequest extends <> { name: <> expand_wildcards?: <> master_timeout?: <> timeout?: <> lifecycle?: <> } ---- [discrete] === Response [source,ts,subs=+macros] ---- type IndicesPutDataLifecycleResponse = <> ---- [discrete] [[client.indices.putIndexTemplate]] == `client.indices.putIndexTemplate()` Create or update an index template. Index templates define settings, mappings, and aliases that can be applied automatically to new indices. {ref}/indices-put-template.html[{es} documentation] [discrete] === Function signature [source,ts] ---- (request: IndicesPutIndexTemplateRequest, options?: TransportRequestOptions) => Promise ---- [discrete] === Request [source,ts,subs=+macros] ---- interface IndicesPutIndexTemplateRequest extends <> { name: <> create?: boolean master_timeout?: <> cause?: string index_patterns?: <> composed_of?: <>[] template?: IndicesPutIndexTemplateIndexTemplateMapping data_stream?: <> priority?: <> version?: <> _meta?: <> allow_auto_create?: boolean ignore_missing_component_templates?: string[] deprecated?: boolean } ---- [discrete] === Response [source,ts,subs=+macros] ---- type IndicesPutIndexTemplateResponse = <> ---- [discrete] [[client.indices.putMapping]] == `client.indices.putMapping()` Update field mappings. Adds new fields to an existing data stream or index. You can also use this API to change the search settings of existing fields. For data streams, these changes are applied to all backing indices by default. {ref}/indices-put-mapping.html[{es} documentation] [discrete] === Function signature [source,ts] ---- (request: IndicesPutMappingRequest, options?: TransportRequestOptions) => Promise ---- [discrete] === Request [source,ts,subs=+macros] ---- interface IndicesPutMappingRequest extends <> { index: <> allow_no_indices?: boolean expand_wildcards?: <> ignore_unavailable?: boolean master_timeout?: <> timeout?: <> write_index_only?: boolean date_detection?: boolean dynamic?: <> dynamic_date_formats?: string[] dynamic_templates?: Record>> | Record>>[] _field_names?: <> _meta?: <> numeric_detection?: boolean properties?: Record<<>, <>> _routing?: <> _source?: <> runtime?: <> } ---- [discrete] === Response [source,ts,subs=+macros] ---- type IndicesPutMappingResponse = <> ---- [discrete] [[client.indices.putSettings]] == `client.indices.putSettings()` Update index settings. Changes dynamic index settings in real time. For data streams, index setting changes are applied to all backing indices by default. {ref}/indices-update-settings.html[{es} documentation] [discrete] === Function signature [source,ts] ---- (request: IndicesPutSettingsRequest, options?: TransportRequestOptions) => Promise ---- [discrete] === Request [source,ts,subs=+macros] ---- interface IndicesPutSettingsRequest extends <> { index?: <> allow_no_indices?: boolean expand_wildcards?: <> flat_settings?: boolean ignore_unavailable?: boolean master_timeout?: <> preserve_existing?: boolean timeout?: <> settings?: <> } ---- [discrete] === Response [source,ts,subs=+macros] ---- type IndicesPutSettingsResponse = <> ---- [discrete] [[client.indices.putTemplate]] == `client.indices.putTemplate()` Create or update an index template. Index templates define settings, mappings, and aliases that can be applied automatically to new indices. {ref}/indices-templates-v1.html[{es} documentation] [discrete] === Function signature [source,ts] ---- (request: IndicesPutTemplateRequest, options?: TransportRequestOptions) => Promise ---- [discrete] === Request [source,ts,subs=+macros] ---- interface IndicesPutTemplateRequest extends <> { name: <> create?: boolean master_timeout?: <> cause?: string aliases?: Record<<>, <>> index_patterns?: string | string[] mappings?: <> order?: <> settings?: <> version?: <> } ---- [discrete] === Response [source,ts,subs=+macros] ---- type IndicesPutTemplateResponse = <> ---- [discrete] [[client.indices.recovery]] == `client.indices.recovery()` Returns information about ongoing and completed shard recoveries for one or more indices. For data streams, the API returns information for the stream’s backing indices. {ref}/indices-recovery.html[{es} documentation] [discrete] === Function signature [source,ts] ---- (request: IndicesRecoveryRequest, options?: TransportRequestOptions) => Promise ---- [discrete] === Request [source,ts,subs=+macros] ---- interface IndicesRecoveryRequest extends <> { index?: <> active_only?: boolean detailed?: boolean } ---- [discrete] === Response [source,ts,subs=+macros] ---- type IndicesRecoveryResponse = Record<<>, IndicesRecoveryRecoveryStatus> ---- [discrete] [[client.indices.refresh]] == `client.indices.refresh()` Refresh an index. A refresh makes recent operations performed on one or more indices available for search. For data streams, the API runs the refresh operation on the stream’s backing indices. {ref}/indices-refresh.html[{es} documentation] [discrete] === Function signature [source,ts] ---- (request: IndicesRefreshRequest, options?: TransportRequestOptions) => Promise ---- [discrete] === Request [source,ts,subs=+macros] ---- interface IndicesRefreshRequest extends <> { index?: <> allow_no_indices?: boolean expand_wildcards?: <> ignore_unavailable?: boolean } ---- [discrete] === Response [source,ts,subs=+macros] ---- type IndicesRefreshResponse = <> ---- [discrete] [[client.indices.reloadSearchAnalyzers]] == `client.indices.reloadSearchAnalyzers()` Reloads an index's search analyzers and their resources. {ref}/indices-reload-analyzers.html[{es} documentation] [discrete] === Function signature [source,ts] ---- (request: IndicesReloadSearchAnalyzersRequest, options?: TransportRequestOptions) => Promise ---- [discrete] === Request [source,ts,subs=+macros] ---- interface IndicesReloadSearchAnalyzersRequest extends <> { index: <> allow_no_indices?: boolean expand_wildcards?: <> ignore_unavailable?: boolean } ---- [discrete] === Response [source,ts,subs=+macros] ---- type IndicesReloadSearchAnalyzersResponse = IndicesReloadSearchAnalyzersReloadResult ---- [discrete] [[client.indices.resolveCluster]] == `client.indices.resolveCluster()` Resolves the specified index expressions to return information about each cluster, including the local cluster, if included. Multiple patterns and remote clusters are supported. {ref}/indices-resolve-cluster-api.html[{es} documentation] [discrete] === Function signature [source,ts] ---- (request: IndicesResolveClusterRequest, options?: TransportRequestOptions) => Promise ---- [discrete] === Request [source,ts,subs=+macros] ---- interface IndicesResolveClusterRequest extends <> { name: <> allow_no_indices?: boolean expand_wildcards?: <> ignore_throttled?: boolean ignore_unavailable?: boolean } ---- [discrete] === Response [source,ts,subs=+macros] ---- type IndicesResolveClusterResponse = Record<<>, IndicesResolveClusterResolveClusterInfo> ---- [discrete] [[client.indices.resolveIndex]] == `client.indices.resolveIndex()` Resolve indices. Resolve the names and/or index patterns for indices, aliases, and data streams. Multiple patterns and remote clusters are supported. {ref}/indices-resolve-index-api.html[{es} documentation] [discrete] === Function signature [source,ts] ---- (request: IndicesResolveIndexRequest, options?: TransportRequestOptions) => Promise ---- [discrete] === Request [source,ts,subs=+macros] ---- interface IndicesResolveIndexRequest extends <> { name: <> expand_wildcards?: <> ignore_unavailable?: boolean allow_no_indices?: boolean } ---- [discrete] === Response [source,ts,subs=+macros] ---- interface IndicesResolveIndexResponse { indices: IndicesResolveIndexResolveIndexItem[] aliases: IndicesResolveIndexResolveIndexAliasItem[] data_streams: IndicesResolveIndexResolveIndexDataStreamsItem[] } ---- [discrete] [[client.indices.rollover]] == `client.indices.rollover()` Roll over to a new index. Creates a new index for a data stream or index alias. {ref}/indices-rollover-index.html[{es} documentation] [discrete] === Function signature [source,ts] ---- (request: IndicesRolloverRequest, options?: TransportRequestOptions) => Promise ---- [discrete] === Request [source,ts,subs=+macros] ---- interface IndicesRolloverRequest extends <> { alias: <> new_index?: <> dry_run?: boolean master_timeout?: <> timeout?: <> wait_for_active_shards?: <> aliases?: Record<<>, <>> conditions?: IndicesRolloverRolloverConditions mappings?: <> settings?: Record } ---- [discrete] === Response [source,ts,subs=+macros] ---- interface IndicesRolloverResponse { acknowledged: boolean conditions: Record dry_run: boolean new_index: string old_index: string rolled_over: boolean shards_acknowledged: boolean } ---- [discrete] [[client.indices.segments]] == `client.indices.segments()` Returns low-level information about the Lucene segments in index shards. For data streams, the API returns information about the stream’s backing indices. {ref}/indices-segments.html[{es} documentation] [discrete] === Function signature [source,ts] ---- (request: IndicesSegmentsRequest, options?: TransportRequestOptions) => Promise ---- [discrete] === Request [source,ts,subs=+macros] ---- interface IndicesSegmentsRequest extends <> { index?: <> allow_no_indices?: boolean expand_wildcards?: <> ignore_unavailable?: boolean } ---- [discrete] === Response [source,ts,subs=+macros] ---- interface IndicesSegmentsResponse { indices: Record _shards: <> } ---- [discrete] [[client.indices.shardStores]] == `client.indices.shardStores()` Retrieves store information about replica shards in one or more indices. For data streams, the API retrieves store information for the stream’s backing indices. {ref}/indices-shards-stores.html[{es} documentation] [discrete] === Function signature [source,ts] ---- (request: IndicesShardStoresRequest, options?: TransportRequestOptions) => Promise ---- [discrete] === Request [source,ts,subs=+macros] ---- interface IndicesShardStoresRequest extends <> { index?: <> allow_no_indices?: boolean expand_wildcards?: <> ignore_unavailable?: boolean status?: IndicesShardStoresShardStoreStatus | IndicesShardStoresShardStoreStatus[] } ---- [discrete] === Response [source,ts,subs=+macros] ---- interface IndicesShardStoresResponse { indices: Record<<>, IndicesShardStoresIndicesShardStores> } ---- [discrete] [[client.indices.shrink]] == `client.indices.shrink()` Shrinks an existing index into a new index with fewer primary shards. {ref}/indices-shrink-index.html[{es} documentation] [discrete] === Function signature [source,ts] ---- (request: IndicesShrinkRequest, options?: TransportRequestOptions) => Promise ---- [discrete] === Request [source,ts,subs=+macros] ---- interface IndicesShrinkRequest extends <> { index: <> target: <> master_timeout?: <> timeout?: <> wait_for_active_shards?: <> aliases?: Record<<>, <>> settings?: Record } ---- [discrete] === Response [source,ts,subs=+macros] ---- interface IndicesShrinkResponse { acknowledged: boolean shards_acknowledged: boolean index: <> } ---- [discrete] [[client.indices.simulateIndexTemplate]] == `client.indices.simulateIndexTemplate()` Simulate an index. Returns the index configuration that would be applied to the specified index from an existing index template. {ref}/indices-simulate-index.html[{es} documentation] [discrete] === Function signature [source,ts] ---- (request: IndicesSimulateIndexTemplateRequest, options?: TransportRequestOptions) => Promise ---- [discrete] === Request [source,ts,subs=+macros] ---- interface IndicesSimulateIndexTemplateRequest extends <> { name: <> master_timeout?: <> include_defaults?: boolean } ---- [discrete] === Response [source,ts,subs=+macros] ---- interface IndicesSimulateIndexTemplateResponse { overlapping?: IndicesSimulateTemplateOverlapping[] template: IndicesSimulateTemplateTemplate } ---- [discrete] [[client.indices.simulateTemplate]] == `client.indices.simulateTemplate()` Simulate an index template. Returns the index configuration that would be applied by a particular index template. {ref}/indices-simulate-template.html[{es} documentation] [discrete] === Function signature [source,ts] ---- (request: IndicesSimulateTemplateRequest, options?: TransportRequestOptions) => Promise ---- [discrete] === Request [source,ts,subs=+macros] ---- interface IndicesSimulateTemplateRequest extends <> { name?: <> create?: boolean master_timeout?: <> include_defaults?: boolean allow_auto_create?: boolean index_patterns?: <> composed_of?: <>[] template?: IndicesPutIndexTemplateIndexTemplateMapping data_stream?: <> priority?: <> version?: <> _meta?: <> ignore_missing_component_templates?: string[] deprecated?: boolean } ---- [discrete] === Response [source,ts,subs=+macros] ---- interface IndicesSimulateTemplateResponse { overlapping?: IndicesSimulateTemplateOverlapping[] template: IndicesSimulateTemplateTemplate } ---- [discrete] [[client.indices.split]] == `client.indices.split()` Splits an existing index into a new index with more primary shards. {ref}/indices-split-index.html[{es} documentation] [discrete] === Function signature [source,ts] ---- (request: IndicesSplitRequest, options?: TransportRequestOptions) => Promise ---- [discrete] === Request [source,ts,subs=+macros] ---- interface IndicesSplitRequest extends <> { index: <> target: <> master_timeout?: <> timeout?: <> wait_for_active_shards?: <> aliases?: Record<<>, <>> settings?: Record } ---- [discrete] === Response [source,ts,subs=+macros] ---- interface IndicesSplitResponse { acknowledged: boolean shards_acknowledged: boolean index: <> } ---- [discrete] [[client.indices.stats]] == `client.indices.stats()` Returns statistics for one or more indices. For data streams, the API retrieves statistics for the stream’s backing indices. {ref}/indices-stats.html[{es} documentation] [discrete] === Function signature [source,ts] ---- (request: IndicesStatsRequest, options?: TransportRequestOptions) => Promise ---- [discrete] === Request [source,ts,subs=+macros] ---- interface IndicesStatsRequest extends <> { metric?: <> index?: <> completion_fields?: <> expand_wildcards?: <> fielddata_fields?: <> fields?: <> forbid_closed_indices?: boolean groups?: string | string[] include_segment_file_sizes?: boolean include_unloaded_segments?: boolean level?: <> } ---- [discrete] === Response [source,ts,subs=+macros] ---- interface IndicesStatsResponse { indices?: Record _shards: <> _all: IndicesStatsIndicesStats } ---- [discrete] [[client.indices.unfreeze]] == `client.indices.unfreeze()` Unfreezes an index. {ref}/unfreeze-index-api.html[{es} documentation] [discrete] === Function signature [source,ts] ---- (request: IndicesUnfreezeRequest, options?: TransportRequestOptions) => Promise ---- [discrete] === Request [source,ts,subs=+macros] ---- interface IndicesUnfreezeRequest extends <> { index: <> allow_no_indices?: boolean expand_wildcards?: <> ignore_unavailable?: boolean master_timeout?: <> timeout?: <> wait_for_active_shards?: string } ---- [discrete] === Response [source,ts,subs=+macros] ---- interface IndicesUnfreezeResponse { acknowledged: boolean shards_acknowledged: boolean } ---- [discrete] [[client.indices.updateAliases]] == `client.indices.updateAliases()` Create or update an alias. Adds a data stream or index to an alias. {ref}/indices-aliases.html[{es} documentation] [discrete] === Function signature [source,ts] ---- (request: IndicesUpdateAliasesRequest, options?: TransportRequestOptions) => Promise ---- [discrete] === Request [source,ts,subs=+macros] ---- interface IndicesUpdateAliasesRequest extends <> { master_timeout?: <> timeout?: <> actions?: IndicesUpdateAliasesAction[] } ---- [discrete] === Response [source,ts,subs=+macros] ---- type IndicesUpdateAliasesResponse = <> ---- [discrete] [[client.indices.validateQuery]] == `client.indices.validateQuery()` Validate a query. Validates a query without running it. {ref}/search-validate.html[{es} documentation] [discrete] === Function signature [source,ts] ---- (request: IndicesValidateQueryRequest, options?: TransportRequestOptions) => Promise ---- [discrete] === Request [source,ts,subs=+macros] ---- interface IndicesValidateQueryRequest extends <> { index?: <> allow_no_indices?: boolean all_shards?: boolean analyzer?: string analyze_wildcard?: boolean default_operator?: <> df?: string expand_wildcards?: <> explain?: boolean ignore_unavailable?: boolean lenient?: boolean rewrite?: boolean q?: string query?: <> } ---- [discrete] === Response [source,ts,subs=+macros] ---- interface IndicesValidateQueryResponse { explanations?: IndicesValidateQueryIndicesValidationExplanation[] _shards?: <> valid: boolean error?: string } ----