Indices

class elasticsearch.client.IndicesClient(client)
Parameters:

client (BaseClient)

add_block(*, index, block, allow_no_indices=None, error_trace=None, expand_wildcards=None, filter_path=None, human=None, ignore_unavailable=None, master_timeout=None, pretty=None, timeout=None)

Adds a block to an index.

https://www.elastic.co/guide/en/elasticsearch/reference/8.14/index-modules-blocks.html

Parameters:
  • index (str) – A comma separated list of indices to add a block to

  • block (Literal['metadata', 'read', 'read_only', 'write'] | str) – The block to add (one of read, write, read_only or metadata)

  • allow_no_indices (bool | None) – Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes _all string or when no indices have been specified)

  • expand_wildcards (Sequence[Literal['all', 'closed', 'hidden', 'none', 'open'] | str] | ~typing.Literal['all', 'closed', 'hidden', 'none', 'open'] | str | None) – Whether to expand wildcard expression to concrete indices that are open, closed or both.

  • ignore_unavailable (bool | None) – Whether specified concrete indices should be ignored when unavailable (missing or closed)

  • master_timeout (Literal[-1] | ~typing.Literal[0] | str | None) – Specify timeout for connection to master

  • timeout (Literal[-1] | ~typing.Literal[0] | str | None) – Explicit operation timeout

  • error_trace (bool | None)

  • filter_path (str | Sequence[str] | None)

  • human (bool | None)

  • pretty (bool | None)

Return type:

ObjectApiResponse[Any]

analyze(*, index=None, analyzer=None, attributes=None, char_filter=None, error_trace=None, explain=None, field=None, filter=None, filter_path=None, human=None, normalizer=None, pretty=None, text=None, tokenizer=None, body=None)

Performs the analysis process on a text and return the tokens breakdown of the text.

https://www.elastic.co/guide/en/elasticsearch/reference/8.14/indices-analyze.html

Parameters:
  • index (str | None) – Index used to derive the analyzer. If specified, the analyzer or field parameter overrides this value. If no index is specified or the index does not have a default analyzer, the analyze API uses the standard analyzer.

  • analyzer (str | None) – The name of the analyzer that should be applied to the provided text. This could be a built-in analyzer, or an analyzer that’s been configured in the index.

  • attributes (Sequence[str] | None) – Array of token attributes used to filter the output of the explain parameter.

  • char_filter (Sequence[str | Mapping[str, Any]] | None) – Array of character filters used to preprocess characters before the tokenizer.

  • explain (bool | None) – If true, the response includes token attributes and additional details.

  • field (str | None) – Field used to derive the analyzer. To use this parameter, you must specify an index. If specified, the analyzer parameter overrides this value.

  • filter (Sequence[str | Mapping[str, Any]] | None) – Array of token filters used to apply after the tokenizer.

  • normalizer (str | None) – Normalizer to use to convert text into a single token.

  • text (str | Sequence[str] | None) – Text to analyze. If an array of strings is provided, it is analyzed as a multi-value field.

  • tokenizer (str | Mapping[str, Any] | None) – Tokenizer to use to convert text into tokens.

  • error_trace (bool | None)

  • filter_path (str | Sequence[str] | None)

  • human (bool | None)

  • pretty (bool | None)

  • body (Dict[str, Any] | None)

Return type:

ObjectApiResponse[Any]

clear_cache(*, index=None, allow_no_indices=None, error_trace=None, expand_wildcards=None, fielddata=None, fields=None, filter_path=None, human=None, ignore_unavailable=None, pretty=None, query=None, request=None)

Clears all or specific caches for one or more indices.

https://www.elastic.co/guide/en/elasticsearch/reference/8.14/indices-clearcache.html

Parameters:
  • index (str | Sequence[str] | None) – Comma-separated list of data streams, indices, and aliases used to limit the request. Supports wildcards (*). To target all data streams and indices, omit this parameter or use * or _all.

  • allow_no_indices (bool | None) – If false, the request returns an error if any wildcard expression, index alias, or _all value targets only missing or closed indices. This behavior applies even if the request targets other open indices.

  • expand_wildcards (Sequence[Literal['all', 'closed', 'hidden', 'none', 'open'] | str] | ~typing.Literal['all', 'closed', 'hidden', 'none', 'open'] | str | None) – Type of index that wildcard patterns can match. If the request can target data streams, this argument determines whether wildcard expressions match hidden data streams. Supports comma-separated values, such as open,hidden. Valid values are: all, open, closed, hidden, none.

  • fielddata (bool | None) – If true, clears the fields cache. Use the fields parameter to clear the cache of specific fields only.

  • fields (str | Sequence[str] | None) – Comma-separated list of field names used to limit the fielddata parameter.

  • ignore_unavailable (bool | None) – If false, the request returns an error if it targets a missing or closed index.

  • query (bool | None) – If true, clears the query cache.

  • request (bool | None) – If true, clears the request cache.

  • error_trace (bool | None)

  • filter_path (str | Sequence[str] | None)

  • human (bool | None)

  • pretty (bool | None)

Return type:

ObjectApiResponse[Any]

clone(*, index, target, aliases=None, error_trace=None, filter_path=None, human=None, master_timeout=None, pretty=None, settings=None, timeout=None, wait_for_active_shards=None, body=None)

Clones an index

https://www.elastic.co/guide/en/elasticsearch/reference/8.14/indices-clone-index.html

Parameters:
  • index (str) – Name of the source index to clone.

  • target (str) – Name of the target index to create.

  • aliases (Mapping[str, Mapping[str, Any]] | None) – Aliases for the resulting index.

  • master_timeout (Literal[-1] | ~typing.Literal[0] | str | None) – Period to wait for a connection to the master node. If no response is received before the timeout expires, the request fails and returns an error.

  • settings (Mapping[str, Any] | None) – Configuration options for the target index.

  • timeout (Literal[-1] | ~typing.Literal[0] | str | None) – Period to wait for a response. If no response is received before the timeout expires, the request fails and returns an error.

  • wait_for_active_shards (int | Literal['all', 'index-setting'] | str | None) – The number of shard copies that must be active before proceeding with the operation. Set to all or any positive integer up to the total number of shards in the index (number_of_replicas+1).

  • error_trace (bool | None)

  • filter_path (str | Sequence[str] | None)

  • human (bool | None)

  • pretty (bool | None)

  • body (Dict[str, Any] | None)

Return type:

ObjectApiResponse[Any]

close(*, index, allow_no_indices=None, error_trace=None, expand_wildcards=None, filter_path=None, human=None, ignore_unavailable=None, master_timeout=None, pretty=None, timeout=None, wait_for_active_shards=None)

Closes an index.

https://www.elastic.co/guide/en/elasticsearch/reference/8.14/indices-close.html

Parameters:
  • index (str | Sequence[str]) – Comma-separated list or wildcard expression of index names used to limit the request.

  • allow_no_indices (bool | None) – If false, the request returns an error if any wildcard expression, index alias, or _all value targets only missing or closed indices. This behavior applies even if the request targets other open indices.

  • expand_wildcards (Sequence[Literal['all', 'closed', 'hidden', 'none', 'open'] | str] | ~typing.Literal['all', 'closed', 'hidden', 'none', 'open'] | str | None) – Type of index that wildcard patterns can match. If the request can target data streams, this argument determines whether wildcard expressions match hidden data streams. Supports comma-separated values, such as open,hidden. Valid values are: all, open, closed, hidden, none.

  • ignore_unavailable (bool | None) – If false, the request returns an error if it targets a missing or closed index.

  • master_timeout (Literal[-1] | ~typing.Literal[0] | str | None) – Period to wait for a connection to the master node. If no response is received before the timeout expires, the request fails and returns an error.

  • timeout (Literal[-1] | ~typing.Literal[0] | str | None) – Period to wait for a response. If no response is received before the timeout expires, the request fails and returns an error.

  • wait_for_active_shards (int | Literal['all', 'index-setting'] | str | None) – The number of shard copies that must be active before proceeding with the operation. Set to all or any positive integer up to the total number of shards in the index (number_of_replicas+1).

  • error_trace (bool | None)

  • filter_path (str | Sequence[str] | None)

  • human (bool | None)

  • pretty (bool | None)

Return type:

ObjectApiResponse[Any]

create(*, index, aliases=None, error_trace=None, filter_path=None, human=None, mappings=None, master_timeout=None, pretty=None, settings=None, timeout=None, wait_for_active_shards=None, body=None)

Creates an index with optional settings and mappings.

https://www.elastic.co/guide/en/elasticsearch/reference/8.14/indices-create-index.html

Parameters:
  • index (str) – Name of the index you wish to create.

  • aliases (Mapping[str, Mapping[str, Any]] | None) – Aliases for the index.

  • mappings (Mapping[str, Any] | None) – Mapping for fields in the index. If specified, this mapping can include: - Field names - Field data types - Mapping parameters

  • master_timeout (Literal[-1] | ~typing.Literal[0] | str | None) – Period to wait for a connection to the master node. If no response is received before the timeout expires, the request fails and returns an error.

  • settings (Mapping[str, Any] | None) – Configuration options for the index.

  • timeout (Literal[-1] | ~typing.Literal[0] | str | None) – Period to wait for a response. If no response is received before the timeout expires, the request fails and returns an error.

  • wait_for_active_shards (int | Literal['all', 'index-setting'] | str | None) – The number of shard copies that must be active before proceeding with the operation. Set to all or any positive integer up to the total number of shards in the index (number_of_replicas+1).

  • error_trace (bool | None)

  • filter_path (str | Sequence[str] | None)

  • human (bool | None)

  • pretty (bool | None)

  • body (Dict[str, Any] | None)

Return type:

ObjectApiResponse[Any]

create_data_stream(*, name, error_trace=None, filter_path=None, human=None, pretty=None)

Creates a data stream

https://www.elastic.co/guide/en/elasticsearch/reference/8.14/data-streams.html

Parameters:
  • name (str) – Name of the data stream, which must meet the following criteria: Lowercase only; Cannot include `, `/, *, ?, , <, >, |, ,, #, :, or a space character; Cannot start with -, _, +, or .ds-; Cannot be . or ..; Cannot be longer than 255 bytes. Multi-byte characters count towards this limit faster.

  • error_trace (bool | None)

  • filter_path (str | Sequence[str] | None)

  • human (bool | None)

  • pretty (bool | None)

Return type:

ObjectApiResponse[Any]

data_streams_stats(*, name=None, error_trace=None, expand_wildcards=None, filter_path=None, human=None, pretty=None)

Provides statistics on operations happening in a data stream.

https://www.elastic.co/guide/en/elasticsearch/reference/8.14/data-streams.html

Parameters:
  • name (str | None) – Comma-separated list of data streams used to limit the request. Wildcard expressions (*) are supported. To target all data streams in a cluster, omit this parameter or use *.

  • expand_wildcards (Sequence[Literal['all', 'closed', 'hidden', 'none', 'open'] | str] | ~typing.Literal['all', 'closed', 'hidden', 'none', 'open'] | str | None) – Type of data stream that wildcard patterns can match. Supports comma-separated values, such as open,hidden.

  • error_trace (bool | None)

  • filter_path (str | Sequence[str] | None)

  • human (bool | None)

  • pretty (bool | None)

Return type:

ObjectApiResponse[Any]

delete(*, index, allow_no_indices=None, error_trace=None, expand_wildcards=None, filter_path=None, human=None, ignore_unavailable=None, master_timeout=None, pretty=None, timeout=None)

Deletes an index.

https://www.elastic.co/guide/en/elasticsearch/reference/8.14/indices-delete-index.html

Parameters:
  • index (str | Sequence[str]) – Comma-separated list of indices to delete. You cannot specify index aliases. By default, this parameter does not support wildcards (*) or _all. To use wildcards or _all, set the action.destructive_requires_name cluster setting to false.

  • allow_no_indices (bool | None) – If false, the request returns an error if any wildcard expression, index alias, or _all value targets only missing or closed indices. This behavior applies even if the request targets other open indices.

  • expand_wildcards (Sequence[Literal['all', 'closed', 'hidden', 'none', 'open'] | str] | ~typing.Literal['all', 'closed', 'hidden', 'none', 'open'] | str | None) – Type of index that wildcard patterns can match. If the request can target data streams, this argument determines whether wildcard expressions match hidden data streams. Supports comma-separated values, such as open,hidden. Valid values are: all, open, closed, hidden, none.

  • ignore_unavailable (bool | None) – If false, the request returns an error if it targets a missing or closed index.

  • master_timeout (Literal[-1] | ~typing.Literal[0] | str | None) – Period to wait for a connection to the master node. If no response is received before the timeout expires, the request fails and returns an error.

  • timeout (Literal[-1] | ~typing.Literal[0] | str | None) – Period to wait for a response. If no response is received before the timeout expires, the request fails and returns an error.

  • error_trace (bool | None)

  • filter_path (str | Sequence[str] | None)

  • human (bool | None)

  • pretty (bool | None)

Return type:

ObjectApiResponse[Any]

delete_alias(*, index, name, error_trace=None, filter_path=None, human=None, master_timeout=None, pretty=None, timeout=None)

Deletes an alias.

https://www.elastic.co/guide/en/elasticsearch/reference/8.14/indices-aliases.html

Parameters:
  • index (str | Sequence[str]) – Comma-separated list of data streams or indices used to limit the request. Supports wildcards (*).

  • name (str | Sequence[str]) – Comma-separated list of aliases to remove. Supports wildcards (*). To remove all aliases, use * or _all.

  • master_timeout (Literal[-1] | ~typing.Literal[0] | str | None) – Period to wait for a connection to the master node. If no response is received before the timeout expires, the request fails and returns an error.

  • timeout (Literal[-1] | ~typing.Literal[0] | str | None) – Period to wait for a response. If no response is received before the timeout expires, the request fails and returns an error.

  • error_trace (bool | None)

  • filter_path (str | Sequence[str] | None)

  • human (bool | None)

  • pretty (bool | None)

Return type:

ObjectApiResponse[Any]

delete_data_lifecycle(*, name, error_trace=None, expand_wildcards=None, filter_path=None, human=None, master_timeout=None, pretty=None, timeout=None)

Deletes the data stream lifecycle of the selected data streams.

https://www.elastic.co/guide/en/elasticsearch/reference/8.14/data-streams-delete-lifecycle.html

Parameters:
  • name (str | Sequence[str]) – A comma-separated list of data streams of which the data stream lifecycle will be deleted; use * to get all data streams

  • expand_wildcards (Sequence[Literal['all', 'closed', 'hidden', 'none', 'open'] | str] | ~typing.Literal['all', 'closed', 'hidden', 'none', 'open'] | str | None) – Whether wildcard expressions should get expanded to open or closed indices (default: open)

  • master_timeout (Literal[-1] | ~typing.Literal[0] | str | None) – Specify timeout for connection to master

  • timeout (Literal[-1] | ~typing.Literal[0] | str | None) – Explicit timestamp for the document

  • error_trace (bool | None)

  • filter_path (str | Sequence[str] | None)

  • human (bool | None)

  • pretty (bool | None)

Return type:

ObjectApiResponse[Any]

delete_data_stream(*, name, error_trace=None, expand_wildcards=None, filter_path=None, human=None, pretty=None)

Deletes a data stream.

https://www.elastic.co/guide/en/elasticsearch/reference/8.14/data-streams.html

Parameters:
  • name (str | Sequence[str]) – Comma-separated list of data streams to delete. Wildcard (*) expressions are supported.

  • expand_wildcards (Sequence[Literal['all', 'closed', 'hidden', 'none', 'open'] | str] | ~typing.Literal['all', 'closed', 'hidden', 'none', 'open'] | str | None) – Type of data stream that wildcard patterns can match. Supports comma-separated values,such as open,hidden.

  • error_trace (bool | None)

  • filter_path (str | Sequence[str] | None)

  • human (bool | None)

  • pretty (bool | None)

Return type:

ObjectApiResponse[Any]

delete_index_template(*, name, error_trace=None, filter_path=None, human=None, master_timeout=None, pretty=None, timeout=None)

Deletes an index template.

https://www.elastic.co/guide/en/elasticsearch/reference/8.14/indices-delete-template.html

Parameters:
  • name (str | Sequence[str]) – Comma-separated list of index template names used to limit the request. Wildcard (*) expressions are supported.

  • master_timeout (Literal[-1] | ~typing.Literal[0] | str | None) – Period to wait for a connection to the master node. If no response is received before the timeout expires, the request fails and returns an error.

  • timeout (Literal[-1] | ~typing.Literal[0] | str | None) – Period to wait for a response. If no response is received before the timeout expires, the request fails and returns an error.

  • error_trace (bool | None)

  • filter_path (str | Sequence[str] | None)

  • human (bool | None)

  • pretty (bool | None)

Return type:

ObjectApiResponse[Any]

delete_template(*, name, error_trace=None, filter_path=None, human=None, master_timeout=None, pretty=None, timeout=None)

Deletes an index template.

https://www.elastic.co/guide/en/elasticsearch/reference/8.14/indices-delete-template-v1.html

Parameters:
  • name (str) – The name of the legacy index template to delete. Wildcard (*) expressions are supported.

  • master_timeout (Literal[-1] | ~typing.Literal[0] | str | None) – Period to wait for a connection to the master node. If no response is received before the timeout expires, the request fails and returns an error.

  • timeout (Literal[-1] | ~typing.Literal[0] | str | None) – Period to wait for a response. If no response is received before the timeout expires, the request fails and returns an error.

  • error_trace (bool | None)

  • filter_path (str | Sequence[str] | None)

  • human (bool | None)

  • pretty (bool | None)

Return type:

ObjectApiResponse[Any]

disk_usage(*, index, allow_no_indices=None, error_trace=None, expand_wildcards=None, filter_path=None, flush=None, human=None, ignore_unavailable=None, pretty=None, run_expensive_tasks=None)

Analyzes the disk usage of each field of an index or data stream

https://www.elastic.co/guide/en/elasticsearch/reference/8.14/indices-disk-usage.html

Parameters:
  • index (str | Sequence[str]) – Comma-separated list of data streams, indices, and aliases used to limit the request. It’s recommended to execute this API with a single index (or the latest backing index of a data stream) as the API consumes resources significantly.

  • allow_no_indices (bool | None) – If false, the request returns an error if any wildcard expression, index alias, or _all value targets only missing or closed indices. This behavior applies even if the request targets other open indices. For example, a request targeting foo*,bar* returns an error if an index starts with foo but no index starts with bar.

  • expand_wildcards (Sequence[Literal['all', 'closed', 'hidden', 'none', 'open'] | str] | ~typing.Literal['all', 'closed', 'hidden', 'none', 'open'] | str | None) – Type of index that wildcard patterns can match. If the request can target data streams, this argument determines whether wildcard expressions match hidden data streams. Supports comma-separated values, such as open,hidden.

  • flush (bool | None) – If true, the API performs a flush before analysis. If false, the response may not include uncommitted data.

  • ignore_unavailable (bool | None) – If true, missing or closed indices are not included in the response.

  • run_expensive_tasks (bool | None) – Analyzing field disk usage is resource-intensive. To use the API, this parameter must be set to true.

  • error_trace (bool | None)

  • filter_path (str | Sequence[str] | None)

  • human (bool | None)

  • pretty (bool | None)

Return type:

ObjectApiResponse[Any]

downsample(*, index, target_index, config=None, body=None, error_trace=None, filter_path=None, human=None, pretty=None)

Downsample an index

https://www.elastic.co/guide/en/elasticsearch/reference/8.14/indices-downsample-data-stream.html

Parameters:
Return type:

ObjectApiResponse[Any]

exists(*, index, allow_no_indices=None, error_trace=None, expand_wildcards=None, filter_path=None, flat_settings=None, human=None, ignore_unavailable=None, include_defaults=None, local=None, pretty=None)

Returns information about whether a particular index exists.

https://www.elastic.co/guide/en/elasticsearch/reference/8.14/indices-exists.html

Parameters:
  • index (str | Sequence[str]) – Comma-separated list of data streams, indices, and aliases. Supports wildcards (*).

  • allow_no_indices (bool | None) – If false, the request returns an error if any wildcard expression, index alias, or _all value targets only missing or closed indices. This behavior applies even if the request targets other open indices.

  • expand_wildcards (Sequence[Literal['all', 'closed', 'hidden', 'none', 'open'] | str] | ~typing.Literal['all', 'closed', 'hidden', 'none', 'open'] | str | None) – Type of index that wildcard patterns can match. If the request can target data streams, this argument determines whether wildcard expressions match hidden data streams. Supports comma-separated values, such as open,hidden. Valid values are: all, open, closed, hidden, none.

  • flat_settings (bool | None) – If true, returns settings in flat format.

  • ignore_unavailable (bool | None) – If false, the request returns an error if it targets a missing or closed index.

  • include_defaults (bool | None) – If true, return all default settings in the response.

  • local (bool | None) – If true, the request retrieves information from the local node only.

  • error_trace (bool | None)

  • filter_path (str | Sequence[str] | None)

  • human (bool | None)

  • pretty (bool | None)

Return type:

HeadApiResponse

exists_alias(*, name, index=None, allow_no_indices=None, error_trace=None, expand_wildcards=None, filter_path=None, human=None, ignore_unavailable=None, local=None, pretty=None)

Returns information about whether a particular alias exists.

https://www.elastic.co/guide/en/elasticsearch/reference/8.14/indices-aliases.html

Parameters:
  • name (str | Sequence[str]) – Comma-separated list of aliases to check. Supports wildcards (*).

  • index (str | Sequence[str] | None) – Comma-separated list of data streams or indices used to limit the request. Supports wildcards (*). To target all data streams and indices, omit this parameter or use * or _all.

  • allow_no_indices (bool | None) – If false, the request returns an error if any wildcard expression, index alias, or _all value targets only missing or closed indices. This behavior applies even if the request targets other open indices.

  • expand_wildcards (Sequence[Literal['all', 'closed', 'hidden', 'none', 'open'] | str] | ~typing.Literal['all', 'closed', 'hidden', 'none', 'open'] | str | None) – Type of index that wildcard patterns can match. If the request can target data streams, this argument determines whether wildcard expressions match hidden data streams. Supports comma-separated values, such as open,hidden. Valid values are: all, open, closed, hidden, none.

  • ignore_unavailable (bool | None) – If false, requests that include a missing data stream or index in the target indices or data streams return an error.

  • local (bool | None) – If true, the request retrieves information from the local node only.

  • error_trace (bool | None)

  • filter_path (str | Sequence[str] | None)

  • human (bool | None)

  • pretty (bool | None)

Return type:

HeadApiResponse

exists_index_template(*, name, error_trace=None, filter_path=None, human=None, master_timeout=None, pretty=None)

Returns information about whether a particular index template exists.

https://www.elastic.co/guide/en/elasticsearch/reference/8.14/index-templates.html

Parameters:
  • name (str) – Comma-separated list of index template names used to limit the request. Wildcard (*) expressions are supported.

  • master_timeout (Literal[-1] | ~typing.Literal[0] | str | None) – Period to wait for a connection to the master node. If no response is received before the timeout expires, the request fails and returns an error.

  • error_trace (bool | None)

  • filter_path (str | Sequence[str] | None)

  • human (bool | None)

  • pretty (bool | None)

Return type:

HeadApiResponse

exists_template(*, name, error_trace=None, filter_path=None, flat_settings=None, human=None, local=None, master_timeout=None, pretty=None)

Returns information about whether a particular index template exists.

https://www.elastic.co/guide/en/elasticsearch/reference/8.14/indices-template-exists-v1.html

Parameters:
  • name (str | Sequence[str]) – The comma separated names of the index templates

  • flat_settings (bool | None) – Return settings in flat format (default: false)

  • local (bool | None) – Return local information, do not retrieve the state from master node (default: false)

  • master_timeout (Literal[-1] | ~typing.Literal[0] | str | None) – Explicit operation timeout for connection to master node

  • error_trace (bool | None)

  • filter_path (str | Sequence[str] | None)

  • human (bool | None)

  • pretty (bool | None)

Return type:

HeadApiResponse

explain_data_lifecycle(*, index, error_trace=None, filter_path=None, human=None, include_defaults=None, master_timeout=None, pretty=None)

Retrieves information about the index’s current data stream lifecycle, such as any potential encountered error, time since creation etc.

https://www.elastic.co/guide/en/elasticsearch/reference/8.14/data-streams-explain-lifecycle.html

Parameters:
  • index (str | Sequence[str]) – The name of the index to explain

  • include_defaults (bool | None) – indicates if the API should return the default values the system uses for the index’s lifecycle

  • master_timeout (Literal[-1] | ~typing.Literal[0] | str | None) – Specify timeout for connection to master

  • error_trace (bool | None)

  • filter_path (str | Sequence[str] | None)

  • human (bool | None)

  • pretty (bool | None)

Return type:

ObjectApiResponse[Any]

field_usage_stats(*, index, allow_no_indices=None, error_trace=None, expand_wildcards=None, fields=None, filter_path=None, human=None, ignore_unavailable=None, master_timeout=None, pretty=None, timeout=None, wait_for_active_shards=None)

Returns the field usage stats for each field of an index

https://www.elastic.co/guide/en/elasticsearch/reference/8.14/field-usage-stats.html

Parameters:
  • index (str | Sequence[str]) – Comma-separated list or wildcard expression of index names used to limit the request.

  • allow_no_indices (bool | None) – If false, the request returns an error if any wildcard expression, index alias, or _all value targets only missing or closed indices. This behavior applies even if the request targets other open indices. For example, a request targeting foo*,bar* returns an error if an index starts with foo but no index starts with bar.

  • expand_wildcards (Sequence[Literal['all', 'closed', 'hidden', 'none', 'open'] | str] | ~typing.Literal['all', 'closed', 'hidden', 'none', 'open'] | str | None) – Type of index that wildcard patterns can match. If the request can target data streams, this argument determines whether wildcard expressions match hidden data streams. Supports comma-separated values, such as open,hidden.

  • fields (str | Sequence[str] | None) – Comma-separated list or wildcard expressions of fields to include in the statistics.

  • ignore_unavailable (bool | None) – If true, missing or closed indices are not included in the response.

  • master_timeout (Literal[-1] | ~typing.Literal[0] | str | None) – Period to wait for a connection to the master node. If no response is received before the timeout expires, the request fails and returns an error.

  • timeout (Literal[-1] | ~typing.Literal[0] | str | None) – Period to wait for a response. If no response is received before the timeout expires, the request fails and returns an error.

  • wait_for_active_shards (int | Literal['all', 'index-setting'] | str | None) – The number of shard copies that must be active before proceeding with the operation. Set to all or any positive integer up to the total number of shards in the index (number_of_replicas+1).

  • error_trace (bool | None)

  • filter_path (str | Sequence[str] | None)

  • human (bool | None)

  • pretty (bool | None)

Return type:

ObjectApiResponse[Any]

flush(*, index=None, allow_no_indices=None, error_trace=None, expand_wildcards=None, filter_path=None, force=None, human=None, ignore_unavailable=None, pretty=None, wait_if_ongoing=None)

Performs the flush operation on one or more indices.

https://www.elastic.co/guide/en/elasticsearch/reference/8.14/indices-flush.html

Parameters:
  • index (str | Sequence[str] | None) – Comma-separated list of data streams, indices, and aliases to flush. Supports wildcards (*). To flush all data streams and indices, omit this parameter or use * or _all.

  • allow_no_indices (bool | None) – If false, the request returns an error if any wildcard expression, index alias, or _all value targets only missing or closed indices. This behavior applies even if the request targets other open indices.

  • expand_wildcards (Sequence[Literal['all', 'closed', 'hidden', 'none', 'open'] | str] | ~typing.Literal['all', 'closed', 'hidden', 'none', 'open'] | str | None) – Type of index that wildcard patterns can match. If the request can target data streams, this argument determines whether wildcard expressions match hidden data streams. Supports comma-separated values, such as open,hidden. Valid values are: all, open, closed, hidden, none.

  • force (bool | None) – If true, the request forces a flush even if there are no changes to commit to the index.

  • ignore_unavailable (bool | None) – If false, the request returns an error if it targets a missing or closed index.

  • wait_if_ongoing (bool | None) – If true, the flush operation blocks until execution when another flush operation is running. If false, Elasticsearch returns an error if you request a flush when another flush operation is running.

  • error_trace (bool | None)

  • filter_path (str | Sequence[str] | None)

  • human (bool | None)

  • pretty (bool | None)

Return type:

ObjectApiResponse[Any]

forcemerge(*, index=None, allow_no_indices=None, error_trace=None, expand_wildcards=None, filter_path=None, flush=None, human=None, ignore_unavailable=None, max_num_segments=None, only_expunge_deletes=None, pretty=None, wait_for_completion=None)

Performs the force merge operation on one or more indices.

https://www.elastic.co/guide/en/elasticsearch/reference/8.14/indices-forcemerge.html

Parameters:
  • index (str | Sequence[str] | None) – A comma-separated list of index names; use _all or empty string to perform the operation on all indices

  • allow_no_indices (bool | None) – Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes _all string or when no indices have been specified)

  • expand_wildcards (Sequence[Literal['all', 'closed', 'hidden', 'none', 'open'] | str] | ~typing.Literal['all', 'closed', 'hidden', 'none', 'open'] | str | None) – Whether to expand wildcard expression to concrete indices that are open, closed or both.

  • flush (bool | None) – Specify whether the index should be flushed after performing the operation (default: true)

  • ignore_unavailable (bool | None) – Whether specified concrete indices should be ignored when unavailable (missing or closed)

  • max_num_segments (int | None) – The number of segments the index should be merged into (default: dynamic)

  • only_expunge_deletes (bool | None) – Specify whether the operation should only expunge deleted documents

  • wait_for_completion (bool | None) – Should the request wait until the force merge is completed.

  • error_trace (bool | None)

  • filter_path (str | Sequence[str] | None)

  • human (bool | None)

  • pretty (bool | None)

Return type:

ObjectApiResponse[Any]

get(*, index, allow_no_indices=None, error_trace=None, expand_wildcards=None, features=None, filter_path=None, flat_settings=None, human=None, ignore_unavailable=None, include_defaults=None, local=None, master_timeout=None, pretty=None)

Returns information about one or more indices.

https://www.elastic.co/guide/en/elasticsearch/reference/8.14/indices-get-index.html

Parameters:
  • index (str | Sequence[str]) – Comma-separated list of data streams, indices, and index aliases used to limit the request. Wildcard expressions (*) are supported.

  • allow_no_indices (bool | None) – If false, the request returns an error if any wildcard expression, index alias, or _all value targets only missing or closed indices. This behavior applies even if the request targets other open indices. For example, a request targeting foo*,bar* returns an error if an index starts with foo but no index starts with bar.

  • expand_wildcards (Sequence[Literal['all', 'closed', 'hidden', 'none', 'open'] | str] | ~typing.Literal['all', 'closed', 'hidden', 'none', 'open'] | str | None) – Type of index that wildcard expressions can match. If the request can target data streams, this argument determines whether wildcard expressions match hidden data streams. Supports comma-separated values, such as open,hidden.

  • features (Sequence[Literal['aliases', 'mappings', 'settings'] | str] | ~typing.Literal['aliases', 'mappings', 'settings'] | str | None) – Return only information on specified index features

  • flat_settings (bool | None) – If true, returns settings in flat format.

  • ignore_unavailable (bool | None) – If false, requests that target a missing index return an error.

  • include_defaults (bool | None) – If true, return all default settings in the response.

  • local (bool | None) – If true, the request retrieves information from the local node only. Defaults to false, which means information is retrieved from the master node.

  • master_timeout (Literal[-1] | ~typing.Literal[0] | str | None) – Period to wait for a connection to the master node. If no response is received before the timeout expires, the request fails and returns an error.

  • error_trace (bool | None)

  • filter_path (str | Sequence[str] | None)

  • human (bool | None)

  • pretty (bool | None)

Return type:

ObjectApiResponse[Any]

get_alias(*, index=None, name=None, allow_no_indices=None, error_trace=None, expand_wildcards=None, filter_path=None, human=None, ignore_unavailable=None, local=None, pretty=None)

Returns an alias.

https://www.elastic.co/guide/en/elasticsearch/reference/8.14/indices-aliases.html

Parameters:
  • index (str | Sequence[str] | None) – Comma-separated list of data streams or indices used to limit the request. Supports wildcards (*). To target all data streams and indices, omit this parameter or use * or _all.

  • name (str | Sequence[str] | None) – Comma-separated list of aliases to retrieve. Supports wildcards (*). To retrieve all aliases, omit this parameter or use * or _all.

  • allow_no_indices (bool | None) – If false, the request returns an error if any wildcard expression, index alias, or _all value targets only missing or closed indices. This behavior applies even if the request targets other open indices.

  • expand_wildcards (Sequence[Literal['all', 'closed', 'hidden', 'none', 'open'] | str] | ~typing.Literal['all', 'closed', 'hidden', 'none', 'open'] | str | None) – Type of index that wildcard patterns can match. If the request can target data streams, this argument determines whether wildcard expressions match hidden data streams. Supports comma-separated values, such as open,hidden. Valid values are: all, open, closed, hidden, none.

  • ignore_unavailable (bool | None) – If false, the request returns an error if it targets a missing or closed index.

  • local (bool | None) – If true, the request retrieves information from the local node only.

  • error_trace (bool | None)

  • filter_path (str | Sequence[str] | None)

  • human (bool | None)

  • pretty (bool | None)

Return type:

ObjectApiResponse[Any]

get_data_lifecycle(*, name, error_trace=None, expand_wildcards=None, filter_path=None, human=None, include_defaults=None, pretty=None)

Returns the data stream lifecycle of the selected data streams.

https://www.elastic.co/guide/en/elasticsearch/reference/8.14/data-streams-get-lifecycle.html

Parameters:
  • name (str | Sequence[str]) – Comma-separated list of data streams to limit the request. Supports wildcards (*). To target all data streams, omit this parameter or use * or _all.

  • expand_wildcards (Sequence[Literal['all', 'closed', 'hidden', 'none', 'open'] | str] | ~typing.Literal['all', 'closed', 'hidden', 'none', 'open'] | str | None) – Type of data stream that wildcard patterns can match. Supports comma-separated values, such as open,hidden. Valid values are: all, open, closed, hidden, none.

  • include_defaults (bool | None) – If true, return all default settings in the response.

  • error_trace (bool | None)

  • filter_path (str | Sequence[str] | None)

  • human (bool | None)

  • pretty (bool | None)

Return type:

ObjectApiResponse[Any]

get_data_stream(*, name=None, error_trace=None, expand_wildcards=None, filter_path=None, human=None, include_defaults=None, pretty=None)

Returns data streams.

https://www.elastic.co/guide/en/elasticsearch/reference/8.14/data-streams.html

Parameters:
  • name (str | Sequence[str] | None) – Comma-separated list of data stream names used to limit the request. Wildcard (*) expressions are supported. If omitted, all data streams are returned.

  • expand_wildcards (Sequence[Literal['all', 'closed', 'hidden', 'none', 'open'] | str] | ~typing.Literal['all', 'closed', 'hidden', 'none', 'open'] | str | None) – Type of data stream that wildcard patterns can match. Supports comma-separated values, such as open,hidden.

  • include_defaults (bool | None) – If true, returns all relevant default configurations for the index template.

  • error_trace (bool | None)

  • filter_path (str | Sequence[str] | None)

  • human (bool | None)

  • pretty (bool | None)

Return type:

ObjectApiResponse[Any]

get_field_mapping(*, fields, index=None, allow_no_indices=None, error_trace=None, expand_wildcards=None, filter_path=None, human=None, ignore_unavailable=None, include_defaults=None, local=None, pretty=None)

Returns mapping for one or more fields.

https://www.elastic.co/guide/en/elasticsearch/reference/8.14/indices-get-field-mapping.html

Parameters:
  • fields (str | Sequence[str]) – Comma-separated list or wildcard expression of fields used to limit returned information.

  • index (str | Sequence[str] | None) – Comma-separated list of data streams, indices, and aliases used to limit the request. Supports wildcards (*). To target all data streams and indices, omit this parameter or use * or _all.

  • allow_no_indices (bool | None) – If false, the request returns an error if any wildcard expression, index alias, or _all value targets only missing or closed indices. This behavior applies even if the request targets other open indices.

  • expand_wildcards (Sequence[Literal['all', 'closed', 'hidden', 'none', 'open'] | str] | ~typing.Literal['all', 'closed', 'hidden', 'none', 'open'] | str | None) – Type of index that wildcard patterns can match. If the request can target data streams, this argument determines whether wildcard expressions match hidden data streams. Supports comma-separated values, such as open,hidden. Valid values are: all, open, closed, hidden, none.

  • ignore_unavailable (bool | None) – If false, the request returns an error if it targets a missing or closed index.

  • include_defaults (bool | None) – If true, return all default settings in the response.

  • local (bool | None) – If true, the request retrieves information from the local node only.

  • error_trace (bool | None)

  • filter_path (str | Sequence[str] | None)

  • human (bool | None)

  • pretty (bool | None)

Return type:

ObjectApiResponse[Any]

get_index_template(*, name=None, error_trace=None, filter_path=None, flat_settings=None, human=None, include_defaults=None, local=None, master_timeout=None, pretty=None)

Returns an index template.

https://www.elastic.co/guide/en/elasticsearch/reference/8.14/indices-get-template.html

Parameters:
  • name (str | None) – Comma-separated list of index template names used to limit the request. Wildcard (*) expressions are supported.

  • flat_settings (bool | None) – If true, returns settings in flat format.

  • include_defaults (bool | None) – If true, returns all relevant default configurations for the index template.

  • local (bool | None) – If true, the request retrieves information from the local node only. Defaults to false, which means information is retrieved from the master node.

  • master_timeout (Literal[-1] | ~typing.Literal[0] | str | None) – Period to wait for a connection to the master node. If no response is received before the timeout expires, the request fails and returns an error.

  • error_trace (bool | None)

  • filter_path (str | Sequence[str] | None)

  • human (bool | None)

  • pretty (bool | None)

Return type:

ObjectApiResponse[Any]

get_mapping(*, index=None, allow_no_indices=None, error_trace=None, expand_wildcards=None, filter_path=None, human=None, ignore_unavailable=None, local=None, master_timeout=None, pretty=None)

Returns mappings for one or more indices.

https://www.elastic.co/guide/en/elasticsearch/reference/8.14/indices-get-mapping.html

Parameters:
  • index (str | Sequence[str] | None) – Comma-separated list of data streams, indices, and aliases used to limit the request. Supports wildcards (*). To target all data streams and indices, omit this parameter or use * or _all.

  • allow_no_indices (bool | None) – If false, the request returns an error if any wildcard expression, index alias, or _all value targets only missing or closed indices. This behavior applies even if the request targets other open indices.

  • expand_wildcards (Sequence[Literal['all', 'closed', 'hidden', 'none', 'open'] | str] | ~typing.Literal['all', 'closed', 'hidden', 'none', 'open'] | str | None) – Type of index that wildcard patterns can match. If the request can target data streams, this argument determines whether wildcard expressions match hidden data streams. Supports comma-separated values, such as open,hidden. Valid values are: all, open, closed, hidden, none.

  • ignore_unavailable (bool | None) – If false, the request returns an error if it targets a missing or closed index.

  • local (bool | None) – If true, the request retrieves information from the local node only.

  • master_timeout (Literal[-1] | ~typing.Literal[0] | str | None) – Period to wait for a connection to the master node. If no response is received before the timeout expires, the request fails and returns an error.

  • error_trace (bool | None)

  • filter_path (str | Sequence[str] | None)

  • human (bool | None)

  • pretty (bool | None)

Return type:

ObjectApiResponse[Any]

get_settings(*, index=None, name=None, allow_no_indices=None, error_trace=None, expand_wildcards=None, filter_path=None, flat_settings=None, human=None, ignore_unavailable=None, include_defaults=None, local=None, master_timeout=None, pretty=None)

Returns settings for one or more indices.

https://www.elastic.co/guide/en/elasticsearch/reference/8.14/indices-get-settings.html

Parameters:
  • index (str | Sequence[str] | None) – Comma-separated list of data streams, indices, and aliases used to limit the request. Supports wildcards (*). To target all data streams and indices, omit this parameter or use * or _all.

  • name (str | Sequence[str] | None) – Comma-separated list or wildcard expression of settings to retrieve.

  • allow_no_indices (bool | None) – If false, the request returns an error if any wildcard expression, index alias, or _all value targets only missing or closed indices. This behavior applies even if the request targets other open indices. For example, a request targeting foo*,bar* returns an error if an index starts with foo but no index starts with bar.

  • expand_wildcards (Sequence[Literal['all', 'closed', 'hidden', 'none', 'open'] | str] | ~typing.Literal['all', 'closed', 'hidden', 'none', 'open'] | str | None) – Type of index that wildcard patterns can match. If the request can target data streams, this argument determines whether wildcard expressions match hidden data streams. Supports comma-separated values, such as open,hidden.

  • flat_settings (bool | None) – If true, returns settings in flat format.

  • ignore_unavailable (bool | None) – If false, the request returns an error if it targets a missing or closed index.

  • include_defaults (bool | None) – If true, return all default settings in the response.

  • local (bool | None) – If true, the request retrieves information from the local node only. If false, information is retrieved from the master node.

  • master_timeout (Literal[-1] | ~typing.Literal[0] | str | None) – Period to wait for a connection to the master node. If no response is received before the timeout expires, the request fails and returns an error.

  • error_trace (bool | None)

  • filter_path (str | Sequence[str] | None)

  • human (bool | None)

  • pretty (bool | None)

Return type:

ObjectApiResponse[Any]

get_template(*, name=None, error_trace=None, filter_path=None, flat_settings=None, human=None, local=None, master_timeout=None, pretty=None)

Returns an index template.

https://www.elastic.co/guide/en/elasticsearch/reference/8.14/indices-get-template-v1.html

Parameters:
  • name (str | Sequence[str] | None) – Comma-separated list of index template names used to limit the request. Wildcard (*) expressions are supported. To return all index templates, omit this parameter or use a value of _all or *.

  • flat_settings (bool | None) – If true, returns settings in flat format.

  • local (bool | None) – If true, the request retrieves information from the local node only.

  • master_timeout (Literal[-1] | ~typing.Literal[0] | str | None) – Period to wait for a connection to the master node. If no response is received before the timeout expires, the request fails and returns an error.

  • error_trace (bool | None)

  • filter_path (str | Sequence[str] | None)

  • human (bool | None)

  • pretty (bool | None)

Return type:

ObjectApiResponse[Any]

migrate_to_data_stream(*, name, error_trace=None, filter_path=None, human=None, pretty=None)

Migrates an alias to a data stream

https://www.elastic.co/guide/en/elasticsearch/reference/8.14/data-streams.html

Parameters:
  • name (str) – Name of the index alias to convert to a data stream.

  • error_trace (bool | None)

  • filter_path (str | Sequence[str] | None)

  • human (bool | None)

  • pretty (bool | None)

Return type:

ObjectApiResponse[Any]

modify_data_stream(*, actions=None, error_trace=None, filter_path=None, human=None, pretty=None, body=None)

Modifies a data stream

https://www.elastic.co/guide/en/elasticsearch/reference/8.14/data-streams.html

Parameters:
Return type:

ObjectApiResponse[Any]

open(*, index, allow_no_indices=None, error_trace=None, expand_wildcards=None, filter_path=None, human=None, ignore_unavailable=None, master_timeout=None, pretty=None, timeout=None, wait_for_active_shards=None)

Opens an index.

https://www.elastic.co/guide/en/elasticsearch/reference/8.14/indices-open-close.html

Parameters:
  • index (str | Sequence[str]) – Comma-separated list of data streams, indices, and aliases used to limit the request. Supports wildcards (*). By default, you must explicitly name the indices you using to limit the request. To limit a request using _all, *, or other wildcard expressions, change the action.destructive_requires_name setting to false. You can update this setting in the elasticsearch.yml file or using the cluster update settings API.

  • allow_no_indices (bool | None) – If false, the request returns an error if any wildcard expression, index alias, or _all value targets only missing or closed indices. This behavior applies even if the request targets other open indices.

  • expand_wildcards (Sequence[Literal['all', 'closed', 'hidden', 'none', 'open'] | str] | ~typing.Literal['all', 'closed', 'hidden', 'none', 'open'] | str | None) – Type of index that wildcard patterns can match. If the request can target data streams, this argument determines whether wildcard expressions match hidden data streams. Supports comma-separated values, such as open,hidden. Valid values are: all, open, closed, hidden, none.

  • ignore_unavailable (bool | None) – If false, the request returns an error if it targets a missing or closed index.

  • master_timeout (Literal[-1] | ~typing.Literal[0] | str | None) – Period to wait for a connection to the master node. If no response is received before the timeout expires, the request fails and returns an error.

  • timeout (Literal[-1] | ~typing.Literal[0] | str | None) – Period to wait for a response. If no response is received before the timeout expires, the request fails and returns an error.

  • wait_for_active_shards (int | Literal['all', 'index-setting'] | str | None) – The number of shard copies that must be active before proceeding with the operation. Set to all or any positive integer up to the total number of shards in the index (number_of_replicas+1).

  • error_trace (bool | None)

  • filter_path (str | Sequence[str] | None)

  • human (bool | None)

  • pretty (bool | None)

Return type:

ObjectApiResponse[Any]

promote_data_stream(*, name, error_trace=None, filter_path=None, human=None, pretty=None)

Promotes a data stream from a replicated data stream managed by CCR to a regular data stream

https://www.elastic.co/guide/en/elasticsearch/reference/8.14/data-streams.html

Parameters:
  • name (str) – The name of the data stream

  • error_trace (bool | None)

  • filter_path (str | Sequence[str] | None)

  • human (bool | None)

  • pretty (bool | None)

Return type:

ObjectApiResponse[Any]

put_alias(*, index, name, error_trace=None, filter=None, filter_path=None, human=None, index_routing=None, is_write_index=None, master_timeout=None, pretty=None, routing=None, search_routing=None, timeout=None, body=None)

Creates or updates an alias.

https://www.elastic.co/guide/en/elasticsearch/reference/8.14/indices-aliases.html

Parameters:
  • index (str | Sequence[str]) – Comma-separated list of data streams or indices to add. Supports wildcards (*). Wildcard patterns that match both data streams and indices return an error.

  • name (str) – Alias to update. If the alias doesn’t exist, the request creates it. Index alias names support date math.

  • filter (Mapping[str, Any] | None) – Query used to limit documents the alias can access.

  • index_routing (str | None) – Value used to route indexing operations to a specific shard. If specified, this overwrites the routing value for indexing operations. Data stream aliases don’t support this parameter.

  • is_write_index (bool | None) – If true, sets the write index or data stream for the alias. If an alias points to multiple indices or data streams and is_write_index isn’t set, the alias rejects write requests. If an index alias points to one index and is_write_index isn’t set, the index automatically acts as the write index. Data stream aliases don’t automatically set a write data stream, even if the alias points to one data stream.

  • master_timeout (Literal[-1] | ~typing.Literal[0] | str | None) – Period to wait for a connection to the master node. If no response is received before the timeout expires, the request fails and returns an error.

  • routing (str | None) – Value used to route indexing and search operations to a specific shard. Data stream aliases don’t support this parameter.

  • search_routing (str | None) – Value used to route search operations to a specific shard. If specified, this overwrites the routing value for search operations. Data stream aliases don’t support this parameter.

  • timeout (Literal[-1] | ~typing.Literal[0] | str | None) – Period to wait for a response. If no response is received before the timeout expires, the request fails and returns an error.

  • error_trace (bool | None)

  • filter_path (str | Sequence[str] | None)

  • human (bool | None)

  • pretty (bool | None)

  • body (Dict[str, Any] | None)

Return type:

ObjectApiResponse[Any]

put_data_lifecycle(*, name, data_retention=None, downsampling=None, error_trace=None, expand_wildcards=None, filter_path=None, human=None, master_timeout=None, pretty=None, timeout=None, body=None)

Updates the data stream lifecycle of the selected data streams.

https://www.elastic.co/guide/en/elasticsearch/reference/8.14/data-streams-put-lifecycle.html

Parameters:
  • name (str | Sequence[str]) – Comma-separated list of data streams used to limit the request. Supports wildcards (*). To target all data streams use * or _all.

  • data_retention (Literal[-1] | ~typing.Literal[0] | str | None) – If defined, every document added to this data stream will be stored at least for this time frame. Any time after this duration the document could be deleted. When empty, every document in this data stream will be stored indefinitely.

  • downsampling (Mapping[str, Any] | None) – If defined, every backing index will execute the configured downsampling configuration after the backing index is not the data stream write index anymore.

  • expand_wildcards (Sequence[Literal['all', 'closed', 'hidden', 'none', 'open'] | str] | ~typing.Literal['all', 'closed', 'hidden', 'none', 'open'] | str | None) – Type of data stream that wildcard patterns can match. Supports comma-separated values, such as open,hidden. Valid values are: all, hidden, open, closed, none.

  • master_timeout (Literal[-1] | ~typing.Literal[0] | str | None) – Period to wait for a connection to the master node. If no response is received before the timeout expires, the request fails and returns an error.

  • timeout (Literal[-1] | ~typing.Literal[0] | str | None) – Period to wait for a response. If no response is received before the timeout expires, the request fails and returns an error.

  • error_trace (bool | None)

  • filter_path (str | Sequence[str] | None)

  • human (bool | None)

  • pretty (bool | None)

  • body (Dict[str, Any] | None)

Return type:

ObjectApiResponse[Any]

put_index_template(*, name, allow_auto_create=None, cause=None, composed_of=None, create=None, data_stream=None, deprecated=None, error_trace=None, filter_path=None, human=None, ignore_missing_component_templates=None, index_patterns=None, master_timeout=None, meta=None, pretty=None, priority=None, template=None, version=None, body=None)

Creates or updates an index template.

https://www.elastic.co/guide/en/elasticsearch/reference/8.14/indices-put-template.html

Parameters:
  • name (str) – Index or template name

  • allow_auto_create (bool | None) – This setting overrides the value of the action.auto_create_index cluster setting. If set to true in a template, then indices can be automatically created using that template even if auto-creation of indices is disabled via actions.auto_create_index. If set to false, then indices or data streams matching the template must always be explicitly created, and may never be automatically created.

  • cause (str | None) – User defined reason for creating/updating the index template

  • composed_of (Sequence[str] | None) – An ordered list of component template names. Component templates are merged in the order specified, meaning that the last component template specified has the highest precedence.

  • create (bool | None) – If true, this request cannot replace or update existing index templates.

  • data_stream (Mapping[str, Any] | None) – If this object is included, the template is used to create data streams and their backing indices. Supports an empty object. Data streams require a matching index template with a data_stream object.

  • deprecated (bool | None) – Marks this index template as deprecated. When creating or updating a non-deprecated index template that uses deprecated components, Elasticsearch will emit a deprecation warning.

  • ignore_missing_component_templates (Sequence[str] | None) – The configuration option ignore_missing_component_templates can be used when an index template references a component template that might not exist

  • index_patterns (str | Sequence[str] | None) – Name of the index template to create.

  • master_timeout (Literal[-1] | ~typing.Literal[0] | str | None) – Period to wait for a connection to the master node. If no response is received before the timeout expires, the request fails and returns an error.

  • meta (Mapping[str, Any] | None) – Optional user metadata about the index template. May have any contents. This map is not automatically generated by Elasticsearch.

  • priority (int | None) – Priority to determine index template precedence when a new data stream or index is created. The index template with the highest priority is chosen. If no priority is specified the template is treated as though it is of priority 0 (lowest priority). This number is not automatically generated by Elasticsearch.

  • template (Mapping[str, Any] | None) – Template to be applied. It may optionally include an aliases, mappings, or settings configuration.

  • version (int | None) – Version number used to manage index templates externally. This number is not automatically generated by Elasticsearch.

  • error_trace (bool | None)

  • filter_path (str | Sequence[str] | None)

  • human (bool | None)

  • pretty (bool | None)

  • body (Dict[str, Any] | None)

Return type:

ObjectApiResponse[Any]

put_mapping(*, index, allow_no_indices=None, date_detection=None, dynamic=None, dynamic_date_formats=None, dynamic_templates=None, error_trace=None, expand_wildcards=None, field_names=None, filter_path=None, human=None, ignore_unavailable=None, master_timeout=None, meta=None, numeric_detection=None, pretty=None, properties=None, routing=None, runtime=None, source=None, timeout=None, write_index_only=None, body=None)

Updates the index mappings.

https://www.elastic.co/guide/en/elasticsearch/reference/8.14/indices-put-mapping.html

Parameters:
  • index (str | Sequence[str]) – A comma-separated list of index names the mapping should be added to (supports wildcards); use _all or omit to add the mapping on all indices.

  • allow_no_indices (bool | None) – If false, the request returns an error if any wildcard expression, index alias, or _all value targets only missing or closed indices. This behavior applies even if the request targets other open indices.

  • date_detection (bool | None) – Controls whether dynamic date detection is enabled.

  • dynamic (Literal['false', 'runtime', 'strict', 'true'] | str | None) – Controls whether new fields are added dynamically.

  • dynamic_date_formats (Sequence[str] | None) – If date detection is enabled then new string fields are checked against ‘dynamic_date_formats’ and if the value matches then a new date field is added instead of string.

  • dynamic_templates (Mapping[str, Mapping[str, Any]] | Sequence[Mapping[str, Mapping[str, Any]]] | None) – Specify dynamic templates for the mapping.

  • expand_wildcards (Sequence[Literal['all', 'closed', 'hidden', 'none', 'open'] | str] | ~typing.Literal['all', 'closed', 'hidden', 'none', 'open'] | str | None) – Type of index that wildcard patterns can match. If the request can target data streams, this argument determines whether wildcard expressions match hidden data streams. Supports comma-separated values, such as open,hidden. Valid values are: all, open, closed, hidden, none.

  • field_names (Mapping[str, Any] | None) – Control whether field names are enabled for the index.

  • ignore_unavailable (bool | None) – If false, the request returns an error if it targets a missing or closed index.

  • master_timeout (Literal[-1] | ~typing.Literal[0] | str | None) – Period to wait for a connection to the master node. If no response is received before the timeout expires, the request fails and returns an error.

  • meta (Mapping[str, Any] | None) – A mapping type can have custom meta data associated with it. These are not used at all by Elasticsearch, but can be used to store application-specific metadata.

  • numeric_detection (bool | None) – Automatically map strings into numeric data types for all fields.

  • properties (Mapping[str, Mapping[str, Any]] | None) – Mapping for a field. For new fields, this mapping can include: - Field name - Field data type - Mapping parameters

  • routing (Mapping[str, Any] | None) – Enable making a routing value required on indexed documents.

  • runtime (Mapping[str, Mapping[str, Any]] | None) – Mapping of runtime fields for the index.

  • source (Mapping[str, Any] | None) – Control whether the _source field is enabled on the index.

  • timeout (Literal[-1] | ~typing.Literal[0] | str | None) – Period to wait for a response. If no response is received before the timeout expires, the request fails and returns an error.

  • write_index_only (bool | None) – If true, the mappings are applied only to the current write index for the target.

  • error_trace (bool | None)

  • filter_path (str | Sequence[str] | None)

  • human (bool | None)

  • pretty (bool | None)

  • body (Dict[str, Any] | None)

Return type:

ObjectApiResponse[Any]

put_settings(*, settings=None, body=None, index=None, allow_no_indices=None, error_trace=None, expand_wildcards=None, filter_path=None, flat_settings=None, human=None, ignore_unavailable=None, master_timeout=None, preserve_existing=None, pretty=None, timeout=None)

Updates the index settings.

https://www.elastic.co/guide/en/elasticsearch/reference/8.14/indices-update-settings.html

Parameters:
  • settings (Mapping[str, Any] | None)

  • index (str | Sequence[str] | None) – Comma-separated list of data streams, indices, and aliases used to limit the request. Supports wildcards (*). To target all data streams and indices, omit this parameter or use * or _all.

  • allow_no_indices (bool | None) – If false, the request returns an error if any wildcard expression, index alias, or _all value targets only missing or closed indices. This behavior applies even if the request targets other open indices. For example, a request targeting foo*,bar* returns an error if an index starts with foo but no index starts with bar.

  • expand_wildcards (Sequence[Literal['all', 'closed', 'hidden', 'none', 'open'] | str] | ~typing.Literal['all', 'closed', 'hidden', 'none', 'open'] | str | None) – Type of index that wildcard patterns can match. If the request can target data streams, this argument determines whether wildcard expressions match hidden data streams. Supports comma-separated values, such as open,hidden.

  • flat_settings (bool | None) – If true, returns settings in flat format.

  • ignore_unavailable (bool | None) – If true, returns settings in flat format.

  • master_timeout (Literal[-1] | ~typing.Literal[0] | str | None) – Period to wait for a connection to the master node. If no response is received before the timeout expires, the request fails and returns an error.

  • preserve_existing (bool | None) – If true, existing index settings remain unchanged.

  • timeout (Literal[-1] | ~typing.Literal[0] | str | None) – Period to wait for a response. If no response is received before the timeout expires, the request fails and returns an error.

  • body (Mapping[str, Any] | None)

  • error_trace (bool | None)

  • filter_path (str | Sequence[str] | None)

  • human (bool | None)

  • pretty (bool | None)

Return type:

ObjectApiResponse[Any]

put_template(*, name, aliases=None, cause=None, create=None, error_trace=None, filter_path=None, human=None, index_patterns=None, mappings=None, master_timeout=None, order=None, pretty=None, settings=None, version=None, body=None)

Creates or updates an index template.

https://www.elastic.co/guide/en/elasticsearch/reference/8.14/indices-templates-v1.html

Parameters:
  • name (str) – The name of the template

  • aliases (Mapping[str, Mapping[str, Any]] | None) – Aliases for the index.

  • cause (str | None)

  • create (bool | None) – If true, this request cannot replace or update existing index templates.

  • index_patterns (str | Sequence[str] | None) – Array of wildcard expressions used to match the names of indices during creation.

  • mappings (Mapping[str, Any] | None) – Mapping for fields in the index.

  • master_timeout (Literal[-1] | ~typing.Literal[0] | str | None) – Period to wait for a connection to the master node. If no response is received before the timeout expires, the request fails and returns an error.

  • order (int | None) – Order in which Elasticsearch applies this template if index matches multiple templates. Templates with lower ‘order’ values are merged first. Templates with higher ‘order’ values are merged later, overriding templates with lower values.

  • settings (Mapping[str, Any] | None) – Configuration options for the index.

  • version (int | None) – Version number used to manage index templates externally. This number is not automatically generated by Elasticsearch.

  • error_trace (bool | None)

  • filter_path (str | Sequence[str] | None)

  • human (bool | None)

  • pretty (bool | None)

  • body (Dict[str, Any] | None)

Return type:

ObjectApiResponse[Any]

recovery(*, index=None, active_only=None, detailed=None, error_trace=None, filter_path=None, human=None, pretty=None)

Returns information about ongoing index shard recoveries.

https://www.elastic.co/guide/en/elasticsearch/reference/8.14/indices-recovery.html

Parameters:
  • index (str | Sequence[str] | None) – Comma-separated list of data streams, indices, and aliases used to limit the request. Supports wildcards (*). To target all data streams and indices, omit this parameter or use * or _all.

  • active_only (bool | None) – If true, the response only includes ongoing shard recoveries.

  • detailed (bool | None) – If true, the response includes detailed information about shard recoveries.

  • error_trace (bool | None)

  • filter_path (str | Sequence[str] | None)

  • human (bool | None)

  • pretty (bool | None)

Return type:

ObjectApiResponse[Any]

refresh(*, index=None, allow_no_indices=None, error_trace=None, expand_wildcards=None, filter_path=None, human=None, ignore_unavailable=None, pretty=None)

Performs the refresh operation in one or more indices.

https://www.elastic.co/guide/en/elasticsearch/reference/8.14/indices-refresh.html

Parameters:
  • index (str | Sequence[str] | None) – Comma-separated list of data streams, indices, and aliases used to limit the request. Supports wildcards (*). To target all data streams and indices, omit this parameter or use * or _all.

  • allow_no_indices (bool | None) – If false, the request returns an error if any wildcard expression, index alias, or _all value targets only missing or closed indices. This behavior applies even if the request targets other open indices.

  • expand_wildcards (Sequence[Literal['all', 'closed', 'hidden', 'none', 'open'] | str] | ~typing.Literal['all', 'closed', 'hidden', 'none', 'open'] | str | None) – Type of index that wildcard patterns can match. If the request can target data streams, this argument determines whether wildcard expressions match hidden data streams. Supports comma-separated values, such as open,hidden. Valid values are: all, open, closed, hidden, none.

  • ignore_unavailable (bool | None) – If false, the request returns an error if it targets a missing or closed index.

  • error_trace (bool | None)

  • filter_path (str | Sequence[str] | None)

  • human (bool | None)

  • pretty (bool | None)

Return type:

ObjectApiResponse[Any]

reload_search_analyzers(*, index, allow_no_indices=None, error_trace=None, expand_wildcards=None, filter_path=None, human=None, ignore_unavailable=None, pretty=None)

Reloads an index’s search analyzers and their resources.

https://www.elastic.co/guide/en/elasticsearch/reference/8.14/indices-reload-analyzers.html

Parameters:
  • index (str | Sequence[str]) – A comma-separated list of index names to reload analyzers for

  • allow_no_indices (bool | None) – Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes _all string or when no indices have been specified)

  • expand_wildcards (Sequence[Literal['all', 'closed', 'hidden', 'none', 'open'] | str] | ~typing.Literal['all', 'closed', 'hidden', 'none', 'open'] | str | None) – Whether to expand wildcard expression to concrete indices that are open, closed or both.

  • ignore_unavailable (bool | None) – Whether specified concrete indices should be ignored when unavailable (missing or closed)

  • error_trace (bool | None)

  • filter_path (str | Sequence[str] | None)

  • human (bool | None)

  • pretty (bool | None)

Return type:

ObjectApiResponse[Any]

resolve_cluster(*, name, allow_no_indices=None, error_trace=None, expand_wildcards=None, filter_path=None, human=None, ignore_throttled=None, ignore_unavailable=None, pretty=None)

Resolves the specified index expressions to return information about each cluster, including the local cluster, if included.

https://www.elastic.co/guide/en/elasticsearch/reference/8.14/indices-resolve-cluster-api.html

Parameters:
  • name (str | Sequence[str]) – Comma-separated name(s) or index pattern(s) of the indices, aliases, and data streams to resolve. Resources on remote clusters can be specified using the <cluster>:<name> syntax.

  • allow_no_indices (bool | None) – If false, the request returns an error if any wildcard expression, index alias, or _all value targets only missing or closed indices. This behavior applies even if the request targets other open indices. For example, a request targeting foo*,bar* returns an error if an index starts with foo but no index starts with bar.

  • expand_wildcards (Sequence[Literal['all', 'closed', 'hidden', 'none', 'open'] | str] | ~typing.Literal['all', 'closed', 'hidden', 'none', 'open'] | str | None) – Type of index that wildcard patterns can match. If the request can target data streams, this argument determines whether wildcard expressions match hidden data streams. Supports comma-separated values, such as open,hidden. Valid values are: all, open, closed, hidden, none.

  • ignore_throttled (bool | None) – If true, concrete, expanded or aliased indices are ignored when frozen. Defaults to false.

  • ignore_unavailable (bool | None) – If false, the request returns an error if it targets a missing or closed index. Defaults to false.

  • error_trace (bool | None)

  • filter_path (str | Sequence[str] | None)

  • human (bool | None)

  • pretty (bool | None)

Return type:

ObjectApiResponse[Any]

resolve_index(*, name, error_trace=None, expand_wildcards=None, filter_path=None, human=None, pretty=None)

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

https://www.elastic.co/guide/en/elasticsearch/reference/8.14/indices-resolve-index-api.html

Parameters:
  • name (str | Sequence[str]) – Comma-separated name(s) or index pattern(s) of the indices, aliases, and data streams to resolve. Resources on remote clusters can be specified using the <cluster>:<name> syntax.

  • expand_wildcards (Sequence[Literal['all', 'closed', 'hidden', 'none', 'open'] | str] | ~typing.Literal['all', 'closed', 'hidden', 'none', 'open'] | str | None) – Type of index that wildcard patterns can match. If the request can target data streams, this argument determines whether wildcard expressions match hidden data streams. Supports comma-separated values, such as open,hidden. Valid values are: all, open, closed, hidden, none.

  • error_trace (bool | None)

  • filter_path (str | Sequence[str] | None)

  • human (bool | None)

  • pretty (bool | None)

Return type:

ObjectApiResponse[Any]

rollover(*, alias, new_index=None, aliases=None, conditions=None, dry_run=None, error_trace=None, filter_path=None, human=None, mappings=None, master_timeout=None, pretty=None, settings=None, timeout=None, wait_for_active_shards=None, body=None)

Updates an alias to point to a new index when the existing index is considered to be too large or too old.

https://www.elastic.co/guide/en/elasticsearch/reference/8.14/indices-rollover-index.html

Parameters:
  • alias (str) – Name of the data stream or index alias to roll over.

  • new_index (str | None) – Name of the index to create. Supports date math. Data streams do not support this parameter.

  • aliases (Mapping[str, Mapping[str, Any]] | None) – Aliases for the target index. Data streams do not support this parameter.

  • conditions (Mapping[str, Any] | None) – Conditions for the rollover. If specified, Elasticsearch only performs the rollover if the current index satisfies these conditions. If this parameter is not specified, Elasticsearch performs the rollover unconditionally. If conditions are specified, at least one of them must be a max_* condition. The index will rollover if any max_* condition is satisfied and all min_* conditions are satisfied.

  • dry_run (bool | None) – If true, checks whether the current index satisfies the specified conditions but does not perform a rollover.

  • mappings (Mapping[str, Any] | None) – Mapping for fields in the index. If specified, this mapping can include field names, field data types, and mapping paramaters.

  • master_timeout (Literal[-1] | ~typing.Literal[0] | str | None) – Period to wait for a connection to the master node. If no response is received before the timeout expires, the request fails and returns an error.

  • settings (Mapping[str, Any] | None) – Configuration options for the index. Data streams do not support this parameter.

  • timeout (Literal[-1] | ~typing.Literal[0] | str | None) – Period to wait for a response. If no response is received before the timeout expires, the request fails and returns an error.

  • wait_for_active_shards (int | Literal['all', 'index-setting'] | str | None) – The number of shard copies that must be active before proceeding with the operation. Set to all or any positive integer up to the total number of shards in the index (number_of_replicas+1).

  • error_trace (bool | None)

  • filter_path (str | Sequence[str] | None)

  • human (bool | None)

  • pretty (bool | None)

  • body (Dict[str, Any] | None)

Return type:

ObjectApiResponse[Any]

segments(*, index=None, allow_no_indices=None, error_trace=None, expand_wildcards=None, filter_path=None, human=None, ignore_unavailable=None, pretty=None, verbose=None)

Provides low-level information about segments in a Lucene index.

https://www.elastic.co/guide/en/elasticsearch/reference/8.14/indices-segments.html

Parameters:
  • index (str | Sequence[str] | None) – Comma-separated list of data streams, indices, and aliases used to limit the request. Supports wildcards (*). To target all data streams and indices, omit this parameter or use * or _all.

  • allow_no_indices (bool | None) – If false, the request returns an error if any wildcard expression, index alias, or _all value targets only missing or closed indices. This behavior applies even if the request targets other open indices.

  • expand_wildcards (Sequence[Literal['all', 'closed', 'hidden', 'none', 'open'] | str] | ~typing.Literal['all', 'closed', 'hidden', 'none', 'open'] | str | None) – Type of index that wildcard patterns can match. If the request can target data streams, this argument determines whether wildcard expressions match hidden data streams. Supports comma-separated values, such as open,hidden. Valid values are: all, open, closed, hidden, none.

  • ignore_unavailable (bool | None) – If false, the request returns an error if it targets a missing or closed index.

  • verbose (bool | None) – If true, the request returns a verbose response.

  • error_trace (bool | None)

  • filter_path (str | Sequence[str] | None)

  • human (bool | None)

  • pretty (bool | None)

Return type:

ObjectApiResponse[Any]

shard_stores(*, index=None, allow_no_indices=None, error_trace=None, expand_wildcards=None, filter_path=None, human=None, ignore_unavailable=None, pretty=None, status=None)

Provides store information for shard copies of indices.

https://www.elastic.co/guide/en/elasticsearch/reference/8.14/indices-shards-stores.html

Parameters:
  • index (str | Sequence[str] | None) – List of data streams, indices, and aliases used to limit the request.

  • allow_no_indices (bool | None) – If false, the request returns an error if any wildcard expression, index alias, or _all value targets only missing or closed indices. This behavior applies even if the request targets other open indices.

  • expand_wildcards (Sequence[Literal['all', 'closed', 'hidden', 'none', 'open'] | str] | ~typing.Literal['all', 'closed', 'hidden', 'none', 'open'] | str | None) – Type of index that wildcard patterns can match. If the request can target data streams, this argument determines whether wildcard expressions match hidden data streams.

  • ignore_unavailable (bool | None) – If true, missing or closed indices are not included in the response.

  • status (Sequence[Literal['all', 'green', 'red', 'yellow'] | str] | ~typing.Literal['all', 'green', 'red', 'yellow'] | str | None) – List of shard health statuses used to limit the request.

  • error_trace (bool | None)

  • filter_path (str | Sequence[str] | None)

  • human (bool | None)

  • pretty (bool | None)

Return type:

ObjectApiResponse[Any]

shrink(*, index, target, aliases=None, error_trace=None, filter_path=None, human=None, master_timeout=None, pretty=None, settings=None, timeout=None, wait_for_active_shards=None, body=None)

Allow to shrink an existing index into a new index with fewer primary shards.

https://www.elastic.co/guide/en/elasticsearch/reference/8.14/indices-shrink-index.html

Parameters:
  • index (str) – Name of the source index to shrink.

  • target (str) – Name of the target index to create.

  • aliases (Mapping[str, Mapping[str, Any]] | None) – The key is the alias name. Index alias names support date math.

  • master_timeout (Literal[-1] | ~typing.Literal[0] | str | None) – Period to wait for a connection to the master node. If no response is received before the timeout expires, the request fails and returns an error.

  • settings (Mapping[str, Any] | None) – Configuration options for the target index.

  • timeout (Literal[-1] | ~typing.Literal[0] | str | None) – Period to wait for a response. If no response is received before the timeout expires, the request fails and returns an error.

  • wait_for_active_shards (int | Literal['all', 'index-setting'] | str | None) – The number of shard copies that must be active before proceeding with the operation. Set to all or any positive integer up to the total number of shards in the index (number_of_replicas+1).

  • error_trace (bool | None)

  • filter_path (str | Sequence[str] | None)

  • human (bool | None)

  • pretty (bool | None)

  • body (Dict[str, Any] | None)

Return type:

ObjectApiResponse[Any]

simulate_index_template(*, name, error_trace=None, filter_path=None, human=None, include_defaults=None, master_timeout=None, pretty=None)

Simulate matching the given index name against the index templates in the system

https://www.elastic.co/guide/en/elasticsearch/reference/8.14/indices-simulate-index.html

Parameters:
  • name (str) – Name of the index to simulate

  • include_defaults (bool | None) – If true, returns all relevant default configurations for the index template.

  • master_timeout (Literal[-1] | ~typing.Literal[0] | str | None) – Period to wait for a connection to the master node. If no response is received before the timeout expires, the request fails and returns an error.

  • error_trace (bool | None)

  • filter_path (str | Sequence[str] | None)

  • human (bool | None)

  • pretty (bool | None)

Return type:

ObjectApiResponse[Any]

simulate_template(*, name=None, allow_auto_create=None, composed_of=None, create=None, data_stream=None, deprecated=None, error_trace=None, filter_path=None, human=None, ignore_missing_component_templates=None, include_defaults=None, index_patterns=None, master_timeout=None, meta=None, pretty=None, priority=None, template=None, version=None, body=None)

Simulate resolving the given template name or body

https://www.elastic.co/guide/en/elasticsearch/reference/8.14/indices-simulate-template.html

Parameters:
  • name (str | None) – Name of the index template to simulate. To test a template configuration before you add it to the cluster, omit this parameter and specify the template configuration in the request body.

  • allow_auto_create (bool | None) – This setting overrides the value of the action.auto_create_index cluster setting. If set to true in a template, then indices can be automatically created using that template even if auto-creation of indices is disabled via actions.auto_create_index. If set to false, then indices or data streams matching the template must always be explicitly created, and may never be automatically created.

  • composed_of (Sequence[str] | None) – An ordered list of component template names. Component templates are merged in the order specified, meaning that the last component template specified has the highest precedence.

  • create (bool | None) – If true, the template passed in the body is only used if no existing templates match the same index patterns. If false, the simulation uses the template with the highest priority. Note that the template is not permanently added or updated in either case; it is only used for the simulation.

  • data_stream (Mapping[str, Any] | None) – If this object is included, the template is used to create data streams and their backing indices. Supports an empty object. Data streams require a matching index template with a data_stream object.

  • deprecated (bool | None) – Marks this index template as deprecated. When creating or updating a non-deprecated index template that uses deprecated components, Elasticsearch will emit a deprecation warning.

  • ignore_missing_component_templates (Sequence[str] | None) – The configuration option ignore_missing_component_templates can be used when an index template references a component template that might not exist

  • include_defaults (bool | None) – If true, returns all relevant default configurations for the index template.

  • index_patterns (str | Sequence[str] | None) – Array of wildcard (*) expressions used to match the names of data streams and indices during creation.

  • master_timeout (Literal[-1] | ~typing.Literal[0] | str | None) – Period to wait for a connection to the master node. If no response is received before the timeout expires, the request fails and returns an error.

  • meta (Mapping[str, Any] | None) – Optional user metadata about the index template. May have any contents. This map is not automatically generated by Elasticsearch.

  • priority (int | None) – Priority to determine index template precedence when a new data stream or index is created. The index template with the highest priority is chosen. If no priority is specified the template is treated as though it is of priority 0 (lowest priority). This number is not automatically generated by Elasticsearch.

  • template (Mapping[str, Any] | None) – Template to be applied. It may optionally include an aliases, mappings, or settings configuration.

  • version (int | None) – Version number used to manage index templates externally. This number is not automatically generated by Elasticsearch.

  • error_trace (bool | None)

  • filter_path (str | Sequence[str] | None)

  • human (bool | None)

  • pretty (bool | None)

  • body (Dict[str, Any] | None)

Return type:

ObjectApiResponse[Any]

split(*, index, target, aliases=None, error_trace=None, filter_path=None, human=None, master_timeout=None, pretty=None, settings=None, timeout=None, wait_for_active_shards=None, body=None)

Allows you to split an existing index into a new index with more primary shards.

https://www.elastic.co/guide/en/elasticsearch/reference/8.14/indices-split-index.html

Parameters:
  • index (str) – Name of the source index to split.

  • target (str) – Name of the target index to create.

  • aliases (Mapping[str, Mapping[str, Any]] | None) – Aliases for the resulting index.

  • master_timeout (Literal[-1] | ~typing.Literal[0] | str | None) – Period to wait for a connection to the master node. If no response is received before the timeout expires, the request fails and returns an error.

  • settings (Mapping[str, Any] | None) – Configuration options for the target index.

  • timeout (Literal[-1] | ~typing.Literal[0] | str | None) – Period to wait for a response. If no response is received before the timeout expires, the request fails and returns an error.

  • wait_for_active_shards (int | Literal['all', 'index-setting'] | str | None) – The number of shard copies that must be active before proceeding with the operation. Set to all or any positive integer up to the total number of shards in the index (number_of_replicas+1).

  • error_trace (bool | None)

  • filter_path (str | Sequence[str] | None)

  • human (bool | None)

  • pretty (bool | None)

  • body (Dict[str, Any] | None)

Return type:

ObjectApiResponse[Any]

stats(*, index=None, metric=None, completion_fields=None, error_trace=None, expand_wildcards=None, fielddata_fields=None, fields=None, filter_path=None, forbid_closed_indices=None, groups=None, human=None, include_segment_file_sizes=None, include_unloaded_segments=None, level=None, pretty=None)

Provides statistics on operations happening in an index.

https://www.elastic.co/guide/en/elasticsearch/reference/8.14/indices-stats.html

Parameters:
  • index (str | Sequence[str] | None) – A comma-separated list of index names; use _all or empty string to perform the operation on all indices

  • metric (str | Sequence[str] | None) – Limit the information returned the specific metrics.

  • completion_fields (str | Sequence[str] | None) – Comma-separated list or wildcard expressions of fields to include in fielddata and suggest statistics.

  • expand_wildcards (Sequence[Literal['all', 'closed', 'hidden', 'none', 'open'] | str] | ~typing.Literal['all', 'closed', 'hidden', 'none', 'open'] | str | None) – Type of index that wildcard patterns can match. If the request can target data streams, this argument determines whether wildcard expressions match hidden data streams. Supports comma-separated values, such as open,hidden.

  • fielddata_fields (str | Sequence[str] | None) – Comma-separated list or wildcard expressions of fields to include in fielddata statistics.

  • fields (str | Sequence[str] | None) – Comma-separated list or wildcard expressions of fields to include in the statistics.

  • forbid_closed_indices (bool | None) – If true, statistics are not collected from closed indices.

  • groups (str | Sequence[str] | None) – Comma-separated list of search groups to include in the search statistics.

  • include_segment_file_sizes (bool | None) – If true, the call reports the aggregated disk usage of each one of the Lucene index files (only applies if segment stats are requested).

  • include_unloaded_segments (bool | None) – If true, the response includes information from segments that are not loaded into memory.

  • level (Literal['cluster', 'indices', 'shards'] | str | None) – Indicates whether statistics are aggregated at the cluster, index, or shard level.

  • error_trace (bool | None)

  • filter_path (str | Sequence[str] | None)

  • human (bool | None)

  • pretty (bool | None)

Return type:

ObjectApiResponse[Any]

unfreeze(*, index, allow_no_indices=None, error_trace=None, expand_wildcards=None, filter_path=None, human=None, ignore_unavailable=None, master_timeout=None, pretty=None, timeout=None, wait_for_active_shards=None)

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

https://www.elastic.co/guide/en/elasticsearch/reference/8.14/unfreeze-index-api.html

Parameters:
  • index (str) – Identifier for the index.

  • allow_no_indices (bool | None) – If false, the request returns an error if any wildcard expression, index alias, or _all value targets only missing or closed indices. This behavior applies even if the request targets other open indices.

  • expand_wildcards (Sequence[Literal['all', 'closed', 'hidden', 'none', 'open'] | str] | ~typing.Literal['all', 'closed', 'hidden', 'none', 'open'] | str | None) – Type of index that wildcard patterns can match. If the request can target data streams, this argument determines whether wildcard expressions match hidden data streams. Supports comma-separated values, such as open,hidden. Valid values are: all, open, closed, hidden, none.

  • ignore_unavailable (bool | None) – If false, the request returns an error if it targets a missing or closed index.

  • master_timeout (Literal[-1] | ~typing.Literal[0] | str | None) – Period to wait for a connection to the master node. If no response is received before the timeout expires, the request fails and returns an error.

  • timeout (Literal[-1] | ~typing.Literal[0] | str | None) – Period to wait for a response. If no response is received before the timeout expires, the request fails and returns an error.

  • wait_for_active_shards (str | None) – The number of shard copies that must be active before proceeding with the operation. Set to all or any positive integer up to the total number of shards in the index (number_of_replicas+1).

  • error_trace (bool | None)

  • filter_path (str | Sequence[str] | None)

  • human (bool | None)

  • pretty (bool | None)

Return type:

ObjectApiResponse[Any]

update_aliases(*, actions=None, error_trace=None, filter_path=None, human=None, master_timeout=None, pretty=None, timeout=None, body=None)

Updates index aliases.

https://www.elastic.co/guide/en/elasticsearch/reference/8.14/indices-aliases.html

Parameters:
  • actions (Sequence[Mapping[str, Any]] | None) – Actions to perform.

  • master_timeout (Literal[-1] | ~typing.Literal[0] | str | None) – Period to wait for a connection to the master node. If no response is received before the timeout expires, the request fails and returns an error.

  • timeout (Literal[-1] | ~typing.Literal[0] | str | None) – Period to wait for a response. If no response is received before the timeout expires, the request fails and returns an error.

  • error_trace (bool | None)

  • filter_path (str | Sequence[str] | None)

  • human (bool | None)

  • pretty (bool | None)

  • body (Dict[str, Any] | None)

Return type:

ObjectApiResponse[Any]

validate_query(*, index=None, all_shards=None, allow_no_indices=None, analyze_wildcard=None, analyzer=None, default_operator=None, df=None, error_trace=None, expand_wildcards=None, explain=None, filter_path=None, human=None, ignore_unavailable=None, lenient=None, pretty=None, q=None, query=None, rewrite=None, body=None)

Allows a user to validate a potentially expensive query without executing it.

https://www.elastic.co/guide/en/elasticsearch/reference/8.14/search-validate.html

Parameters:
  • index (str | Sequence[str] | None) – Comma-separated list of data streams, indices, and aliases to search. Supports wildcards (*). To search all data streams or indices, omit this parameter or use * or _all.

  • all_shards (bool | None) – If true, the validation is executed on all shards instead of one random shard per index.

  • allow_no_indices (bool | None) – If false, the request returns an error if any wildcard expression, index alias, or _all value targets only missing or closed indices. This behavior applies even if the request targets other open indices.

  • analyze_wildcard (bool | None) – If true, wildcard and prefix queries are analyzed.

  • analyzer (str | None) – Analyzer to use for the query string. This parameter can only be used when the q query string parameter is specified.

  • default_operator (Literal['and', 'or'] | str | None) – The default operator for query string query: AND or OR.

  • df (str | None) – Field to use as default where no field prefix is given in the query string. This parameter can only be used when the q query string parameter is specified.

  • expand_wildcards (Sequence[Literal['all', 'closed', 'hidden', 'none', 'open'] | str] | ~typing.Literal['all', 'closed', 'hidden', 'none', 'open'] | str | None) – Type of index that wildcard patterns can match. If the request can target data streams, this argument determines whether wildcard expressions match hidden data streams. Supports comma-separated values, such as open,hidden. Valid values are: all, open, closed, hidden, none.

  • explain (bool | None) – If true, the response returns detailed information if an error has occurred.

  • ignore_unavailable (bool | None) – If false, the request returns an error if it targets a missing or closed index.

  • lenient (bool | None) – If true, format-based query failures (such as providing text to a numeric field) in the query string will be ignored.

  • q (str | None) – Query in the Lucene query string syntax.

  • query (Mapping[str, Any] | None) – Query in the Lucene query string syntax.

  • rewrite (bool | None) – If true, returns a more detailed explanation showing the actual Lucene query that will be executed.

  • error_trace (bool | None)

  • filter_path (str | Sequence[str] | None)

  • human (bool | None)

  • pretty (bool | None)

  • body (Dict[str, Any] | None)

Return type:

ObjectApiResponse[Any]