Elasticsearch API Reference

All the API calls map the raw REST API as closely as possible, including the distinction between required and optional arguments to the calls. Keyword arguments are required for all

Note

Some API parameters in Elasticsearch are reserved keywords in Python. For example the from query parameter for pagination would be aliased as from_.

Elasticsearch

class elasticsearch_serverless.Elasticsearch(host: str | ~typing.Mapping[str, str | int] | ~elastic_transport.NodeConfig | None = None, hosts: ~typing.List[str | ~typing.Mapping[str, str | int] | ~elastic_transport.NodeConfig] | None = None, *, cloud_id: str | None = None, api_key: str | ~typing.Tuple[str, str] | None = None, basic_auth: str | ~typing.Tuple[str, str] | None = None, bearer_auth: str | None = None, opaque_id: str | None = None, headers: ~elastic_transport.client_utils.DefaultType | ~typing.Mapping[str, str] = DefaultType.value, connections: ~elastic_transport.client_utils.DefaultType | int = DefaultType.value, http_compress: ~elastic_transport.client_utils.DefaultType | bool = True, verify_certs: ~elastic_transport.client_utils.DefaultType | bool = DefaultType.value, ca_certs: ~elastic_transport.client_utils.DefaultType | str = DefaultType.value, client_cert: ~elastic_transport.client_utils.DefaultType | str = DefaultType.value, client_key: ~elastic_transport.client_utils.DefaultType | str = DefaultType.value, ssl_assert_hostname: ~elastic_transport.client_utils.DefaultType | str = DefaultType.value, ssl_assert_fingerprint: ~elastic_transport.client_utils.DefaultType | str = DefaultType.value, ssl_version: ~elastic_transport.client_utils.DefaultType | int = DefaultType.value, ssl_context: ~elastic_transport.client_utils.DefaultType | ~typing.Any = DefaultType.value, ssl_show_warn: ~elastic_transport.client_utils.DefaultType | bool = DefaultType.value, transport_class: ~typing.Type[~elastic_transport.Transport] = <class 'elastic_transport.Transport'>, request_timeout: ~elastic_transport.client_utils.DefaultType | None | float = DefaultType.value, node_class: ~elastic_transport.client_utils.DefaultType | ~typing.Type[~elastic_transport.BaseNode] = DefaultType.value, node_pool_class: ~elastic_transport.client_utils.DefaultType | ~typing.Type[~elastic_transport.NodePool] = DefaultType.value, dead_node_backoff_factor: ~elastic_transport.client_utils.DefaultType | float = DefaultType.value, max_dead_node_backoff: ~elastic_transport.client_utils.DefaultType | float = DefaultType.value, serializer: ~elastic_transport.Serializer | None = None, serializers: ~elastic_transport.client_utils.DefaultType | ~typing.Mapping[str, ~elastic_transport.Serializer] = DefaultType.value, default_mimetype: str = 'application/json', max_retries: ~elastic_transport.client_utils.DefaultType | int = DefaultType.value, retry_on_status: ~elastic_transport.client_utils.DefaultType | int | ~typing.Collection[int] = DefaultType.value, retry_on_timeout: ~elastic_transport.client_utils.DefaultType | bool = DefaultType.value, meta_header: ~elastic_transport.client_utils.DefaultType | bool = DefaultType.value, timeout: ~elastic_transport.client_utils.DefaultType | None | float = DefaultType.value, http_auth: ~elastic_transport.client_utils.DefaultType | ~typing.Any = DefaultType.value, _transport: ~elastic_transport.Transport | None = None)

Elasticsearch low-level client. Provides a straightforward mapping from Python to Elasticsearch REST APIs.

The client instance has additional attributes to update APIs in different namespaces such as async_search, indices, security, and more:

client = Elasticsearch("http://localhost:9200")

# Get Document API
client.get(index="*", id="1")

# Get Index API
client.indices.get(index="*")

Transport options can be set on the client constructor or using the options() method:

# Set 'api_key' on the constructor
client = Elasticsearch(
    "http://localhost:9200",
    api_key=("id", "api_key")
)
client.search(...)

# Set 'api_key' per request
client.options(api_key=("id", "api_key")).search(...)
bulk(*, operations: Sequence[Mapping[str, Any]] | None = None, body: Sequence[Mapping[str, Any]] | None = None, index: str | None = None, error_trace: bool | None = None, filter_path: str | Sequence[str] | None = None, human: bool | None = None, pipeline: str | None = None, pretty: bool | None = None, refresh: Literal['false', 'true', 'wait_for'] | bool | str | None = None, require_alias: bool | None = None, routing: str | None = None, source: bool | str | Sequence[str] | None = None, source_excludes: str | Sequence[str] | None = None, source_includes: str | Sequence[str] | None = None, timeout: Literal[0] | str | None = None, wait_for_active_shards: int | Literal['all', 'index-setting'] | str | None = None) ObjectApiResponse[Any]

Allows to perform multiple index/update/delete operations in a single request.

https://www.elastic.co/guide/en/elasticsearch/reference/master/docs-bulk.html

Parameters:
  • operations

  • index – Name of the data stream, index, or index alias to perform bulk actions on.

  • pipeline – ID of the pipeline to use to preprocess incoming documents. If the index has a default ingest pipeline specified, then setting the value to _none disables the default ingest pipeline for this request. If a final pipeline is configured it will always run, regardless of the value of this parameter.

  • refresh – If true, Elasticsearch refreshes the affected shards to make this operation visible to search, if wait_for then wait for a refresh to make this operation visible to search, if false do nothing with refreshes. Valid values: true, false, wait_for.

  • require_alias – If true, the request’s actions must target an index alias.

  • routing – Custom value used to route operations to a specific shard.

  • sourcetrue or false to return the _source field or not, or a list of fields to return.

  • source_excludes – A comma-separated list of source fields to exclude from the response.

  • source_includes – A comma-separated list of source fields to include in the response.

  • timeout – Period each action waits for the following operations: automatic index creation, dynamic mapping updates, waiting for active shards.

  • wait_for_active_shards – 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).

clear_scroll(*, error_trace: bool | None = None, filter_path: str | Sequence[str] | None = None, human: bool | None = None, pretty: bool | None = None, scroll_id: str | Sequence[str] | None = None, body: Dict[str, Any] | None = None) ObjectApiResponse[Any]

Explicitly clears the search context for a scroll.

https://www.elastic.co/guide/en/elasticsearch/reference/master/clear-scroll-api.html

Parameters:

scroll_id – Scroll IDs to clear. To clear all scroll IDs, use _all.

close() None

Closes the Transport and all internal connections

close_point_in_time(*, id: str | None = None, error_trace: bool | None = None, filter_path: str | Sequence[str] | None = None, human: bool | None = None, pretty: bool | None = None, body: Dict[str, Any] | None = None) ObjectApiResponse[Any]

Close a point in time

https://www.elastic.co/guide/en/elasticsearch/reference/master/point-in-time-api.html

Parameters:

id – The ID of the point-in-time.

count(*, index: str | Sequence[str] | None = None, allow_no_indices: bool | None = None, analyze_wildcard: bool | None = None, analyzer: str | None = None, default_operator: Literal['and', 'or'] | str | None = None, df: str | None = None, error_trace: bool | None = None, expand_wildcards: Sequence[Literal['all', 'closed', 'hidden', 'none', 'open'] | str] | Literal['all', 'closed', 'hidden', 'none', 'open'] | str | None = None, filter_path: str | Sequence[str] | None = None, human: bool | None = None, ignore_throttled: bool | None = None, ignore_unavailable: bool | None = None, lenient: bool | None = None, min_score: float | None = None, preference: str | None = None, pretty: bool | None = None, q: str | None = None, query: Mapping[str, Any] | None = None, routing: str | None = None, terminate_after: int | None = None, body: Dict[str, Any] | None = None) ObjectApiResponse[Any]

Returns number of documents matching a query.

https://www.elastic.co/guide/en/elasticsearch/reference/master/search-count.html

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

  • allow_no_indices – 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 – If true, wildcard and prefix queries are analyzed. This parameter can only be used when the q query string parameter is specified.

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

  • default_operator – The default operator for query string query: AND or OR. This parameter can only be used when the q query string parameter is specified.

  • df – 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 – 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.

  • ignore_throttled – If true, concrete, expanded or aliased indices are ignored when frozen.

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

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

  • min_score – Sets the minimum _score value that documents must have to be included in the result.

  • preference – Specifies the node or shard the operation should be performed on. Random by default.

  • q – Query in the Lucene query string syntax.

  • query – Defines the search definition using the Query DSL.

  • routing – Custom value used to route operations to a specific shard.

  • terminate_after – Maximum number of documents to collect for each shard. If a query reaches this limit, Elasticsearch terminates the query early. Elasticsearch collects documents before sorting.

create(*, index: str, id: str, document: Mapping[str, Any] | None = None, body: Mapping[str, Any] | None = None, error_trace: bool | None = None, filter_path: str | Sequence[str] | None = None, human: bool | None = None, pipeline: str | None = None, pretty: bool | None = None, refresh: Literal['false', 'true', 'wait_for'] | bool | str | None = None, routing: str | None = None, timeout: Literal[0] | str | None = None, version: int | None = None, version_type: Literal['external', 'external_gte', 'force', 'internal'] | str | None = None, wait_for_active_shards: int | Literal['all', 'index-setting'] | str | None = None) ObjectApiResponse[Any]

Creates a new document in the index. Returns a 409 response when a document with a same ID already exists in the index.

https://www.elastic.co/guide/en/elasticsearch/reference/master/docs-index_.html

Parameters:
  • index – Name of the data stream or index to target. If the target doesn’t exist and matches the name or wildcard (*) pattern of an index template with a data_stream definition, this request creates the data stream. If the target doesn’t exist and doesn’t match a data stream template, this request creates the index.

  • id – Unique identifier for the document.

  • document

  • pipeline – ID of the pipeline to use to preprocess incoming documents. If the index has a default ingest pipeline specified, then setting the value to _none disables the default ingest pipeline for this request. If a final pipeline is configured it will always run, regardless of the value of this parameter.

  • refresh – If true, Elasticsearch refreshes the affected shards to make this operation visible to search, if wait_for then wait for a refresh to make this operation visible to search, if false do nothing with refreshes. Valid values: true, false, wait_for.

  • routing – Custom value used to route operations to a specific shard.

  • timeout – Period the request waits for the following operations: automatic index creation, dynamic mapping updates, waiting for active shards.

  • version – Explicit version number for concurrency control. The specified version must match the current version of the document for the request to succeed.

  • version_type – Specific version type: external, external_gte.

  • wait_for_active_shards – 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).

delete(*, index: str, id: str, error_trace: bool | None = None, filter_path: str | Sequence[str] | None = None, human: bool | None = None, if_primary_term: int | None = None, if_seq_no: int | None = None, pretty: bool | None = None, refresh: Literal['false', 'true', 'wait_for'] | bool | str | None = None, routing: str | None = None, timeout: Literal[0] | str | None = None, version: int | None = None, version_type: Literal['external', 'external_gte', 'force', 'internal'] | str | None = None, wait_for_active_shards: int | Literal['all', 'index-setting'] | str | None = None) ObjectApiResponse[Any]

Removes a document from the index.

https://www.elastic.co/guide/en/elasticsearch/reference/master/docs-delete.html

Parameters:
  • index – Name of the target index.

  • id – Unique identifier for the document.

  • if_primary_term – Only perform the operation if the document has this primary term.

  • if_seq_no – Only perform the operation if the document has this sequence number.

  • refresh – If true, Elasticsearch refreshes the affected shards to make this operation visible to search, if wait_for then wait for a refresh to make this operation visible to search, if false do nothing with refreshes. Valid values: true, false, wait_for.

  • routing – Custom value used to route operations to a specific shard.

  • timeout – Period to wait for active shards.

  • version – Explicit version number for concurrency control. The specified version must match the current version of the document for the request to succeed.

  • version_type – Specific version type: external, external_gte.

  • wait_for_active_shards – 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).

delete_by_query(*, index: str | Sequence[str], allow_no_indices: bool | None = None, analyze_wildcard: bool | None = None, analyzer: str | None = None, conflicts: Literal['abort', 'proceed'] | str | None = None, default_operator: Literal['and', 'or'] | str | None = None, df: str | None = None, error_trace: bool | None = None, expand_wildcards: Sequence[Literal['all', 'closed', 'hidden', 'none', 'open'] | str] | Literal['all', 'closed', 'hidden', 'none', 'open'] | str | None = None, filter_path: str | Sequence[str] | None = None, from_: int | None = None, human: bool | None = None, ignore_unavailable: bool | None = None, lenient: bool | None = None, max_docs: int | None = None, preference: str | None = None, pretty: bool | None = None, q: str | None = None, query: Mapping[str, Any] | None = None, refresh: bool | None = None, request_cache: bool | None = None, requests_per_second: float | None = None, routing: str | None = None, scroll: Literal[0] | str | None = None, scroll_size: int | None = None, search_timeout: Literal[0] | str | None = None, search_type: Literal['dfs_query_then_fetch', 'query_then_fetch'] | str | None = None, slice: Mapping[str, Any] | None = None, slices: int | Literal['auto'] | str | None = None, sort: Sequence[str] | None = None, stats: Sequence[str] | None = None, terminate_after: int | None = None, timeout: Literal[0] | str | None = None, version: bool | None = None, wait_for_active_shards: int | Literal['all', 'index-setting'] | str | None = None, wait_for_completion: bool | None = None, body: Dict[str, Any] | None = None) ObjectApiResponse[Any]

Deletes documents matching the provided query.

https://www.elastic.co/guide/en/elasticsearch/reference/master/docs-delete-by-query.html

Parameters:
  • index – 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.

  • allow_no_indices – 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.

  • analyze_wildcard – If true, wildcard and prefix queries are analyzed.

  • analyzer – Analyzer to use for the query string.

  • conflicts – What to do if delete by query hits version conflicts: abort or proceed.

  • default_operator – The default operator for query string query: AND or OR.

  • df – Field to use as default where no field prefix is given in the query string.

  • expand_wildcards – 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.

  • from – Starting offset (default: 0)

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

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

  • max_docs – The maximum number of documents to delete.

  • preference – Specifies the node or shard the operation should be performed on. Random by default.

  • q – Query in the Lucene query string syntax.

  • query – Specifies the documents to delete using the Query DSL.

  • refresh – If true, Elasticsearch refreshes all shards involved in the delete by query after the request completes.

  • request_cache – If true, the request cache is used for this request. Defaults to the index-level setting.

  • requests_per_second – The throttle for this request in sub-requests per second.

  • routing – Custom value used to route operations to a specific shard.

  • scroll – Period to retain the search context for scrolling.

  • scroll_size – Size of the scroll request that powers the operation.

  • search_timeout – Explicit timeout for each search request. Defaults to no timeout.

  • search_type – The type of the search operation. Available options: query_then_fetch, dfs_query_then_fetch.

  • slice – Slice the request manually using the provided slice ID and total number of slices.

  • slices – The number of slices this task should be divided into.

  • sort – A comma-separated list of <field>:<direction> pairs.

  • stats – Specific tag of the request for logging and statistical purposes.

  • terminate_after – Maximum number of documents to collect for each shard. If a query reaches this limit, Elasticsearch terminates the query early. Elasticsearch collects documents before sorting. Use with caution. Elasticsearch applies this parameter to each shard handling the request. When possible, let Elasticsearch perform early termination automatically. Avoid specifying this parameter for requests that target data streams with backing indices across multiple data tiers.

  • timeout – Period each deletion request waits for active shards.

  • version – If true, returns the document version as part of a hit.

  • wait_for_active_shards – 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).

  • wait_for_completion – If true, the request blocks until the operation is complete.

delete_script(*, id: str, error_trace: bool | None = None, filter_path: str | Sequence[str] | None = None, human: bool | None = None, master_timeout: Literal[0] | str | None = None, pretty: bool | None = None, timeout: Literal[0] | str | None = None) ObjectApiResponse[Any]

Deletes a script.

https://www.elastic.co/guide/en/elasticsearch/reference/master/modules-scripting.html

Parameters:
  • id – Identifier for the stored script or search template.

  • master_timeout – 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 – Period to wait for a response. If no response is received before the timeout expires, the request fails and returns an error.

exists(*, index: str, id: str, error_trace: bool | None = None, filter_path: str | Sequence[str] | None = None, human: bool | None = None, preference: str | None = None, pretty: bool | None = None, realtime: bool | None = None, refresh: bool | None = None, routing: str | None = None, source: bool | str | Sequence[str] | None = None, source_excludes: str | Sequence[str] | None = None, source_includes: str | Sequence[str] | None = None, stored_fields: str | Sequence[str] | None = None, version: int | None = None, version_type: Literal['external', 'external_gte', 'force', 'internal'] | str | None = None) HeadApiResponse

Returns information about whether a document exists in an index.

https://www.elastic.co/guide/en/elasticsearch/reference/master/docs-get.html

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

  • id – Identifier of the document.

  • preference – Specifies the node or shard the operation should be performed on. Random by default.

  • realtime – If true, the request is real-time as opposed to near-real-time.

  • refresh – If true, Elasticsearch refreshes all shards involved in the delete by query after the request completes.

  • routing – Target the specified primary shard.

  • sourcetrue or false to return the _source field or not, or a list of fields to return.

  • source_excludes – A comma-separated list of source fields to exclude in the response.

  • source_includes – A comma-separated list of source fields to include in the response.

  • stored_fields – List of stored fields to return as part of a hit. If no fields are specified, no stored fields are included in the response. If this field is specified, the _source parameter defaults to false.

  • version – Explicit version number for concurrency control. The specified version must match the current version of the document for the request to succeed.

  • version_type – Specific version type: external, external_gte.

exists_source(*, index: str, id: str, error_trace: bool | None = None, filter_path: str | Sequence[str] | None = None, human: bool | None = None, preference: str | None = None, pretty: bool | None = None, realtime: bool | None = None, refresh: bool | None = None, routing: str | None = None, source: bool | str | Sequence[str] | None = None, source_excludes: str | Sequence[str] | None = None, source_includes: str | Sequence[str] | None = None, version: int | None = None, version_type: Literal['external', 'external_gte', 'force', 'internal'] | str | None = None) HeadApiResponse

Returns information about whether a document source exists in an index.

https://www.elastic.co/guide/en/elasticsearch/reference/master/docs-get.html

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

  • id – Identifier of the document.

  • preference – Specifies the node or shard the operation should be performed on. Random by default.

  • realtime – If true, the request is real-time as opposed to near-real-time.

  • refresh – If true, Elasticsearch refreshes all shards involved in the delete by query after the request completes.

  • routing – Target the specified primary shard.

  • sourcetrue or false to return the _source field or not, or a list of fields to return.

  • source_excludes – A comma-separated list of source fields to exclude in the response.

  • source_includes – A comma-separated list of source fields to include in the response.

  • version – Explicit version number for concurrency control. The specified version must match the current version of the document for the request to succeed.

  • version_type – Specific version type: external, external_gte.

explain(*, index: str, id: str, analyze_wildcard: bool | None = None, analyzer: str | None = None, default_operator: Literal['and', 'or'] | str | None = None, df: str | None = None, error_trace: bool | None = None, filter_path: str | Sequence[str] | None = None, human: bool | None = None, lenient: bool | None = None, preference: str | None = None, pretty: bool | None = None, q: str | None = None, query: Mapping[str, Any] | None = None, routing: str | None = None, source: bool | str | Sequence[str] | None = None, source_excludes: str | Sequence[str] | None = None, source_includes: str | Sequence[str] | None = None, stored_fields: str | Sequence[str] | None = None, body: Dict[str, Any] | None = None) ObjectApiResponse[Any]

Returns information about why a specific matches (or doesn’t match) a query.

https://www.elastic.co/guide/en/elasticsearch/reference/master/search-explain.html

Parameters:
  • index – Index names used to limit the request. Only a single index name can be provided to this parameter.

  • id – Defines the document ID.

  • analyze_wildcard – If true, wildcard and prefix queries are analyzed.

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

  • default_operator – The default operator for query string query: AND or OR.

  • df – Field to use as default where no field prefix is given in the query string.

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

  • preference – Specifies the node or shard the operation should be performed on. Random by default.

  • q – Query in the Lucene query string syntax.

  • query – Defines the search definition using the Query DSL.

  • routing – Custom value used to route operations to a specific shard.

  • source – True or false to return the _source field or not, or a list of fields to return.

  • source_excludes – A comma-separated list of source fields to exclude from the response.

  • source_includes – A comma-separated list of source fields to include in the response.

  • stored_fields – A comma-separated list of stored fields to return in the response.

field_caps(*, index: str | Sequence[str] | None = None, allow_no_indices: bool | None = None, error_trace: bool | None = None, expand_wildcards: Sequence[Literal['all', 'closed', 'hidden', 'none', 'open'] | str] | Literal['all', 'closed', 'hidden', 'none', 'open'] | str | None = None, fields: str | Sequence[str] | None = None, filter_path: str | Sequence[str] | None = None, filters: str | None = None, human: bool | None = None, ignore_unavailable: bool | None = None, include_empty_fields: bool | None = None, include_unmapped: bool | None = None, index_filter: Mapping[str, Any] | None = None, pretty: bool | None = None, runtime_mappings: Mapping[str, Mapping[str, Any]] | None = None, types: Sequence[str] | None = None, body: Dict[str, Any] | None = None) ObjectApiResponse[Any]

Returns the information about the capabilities of fields among multiple indices.

https://www.elastic.co/guide/en/elasticsearch/reference/master/search-field-caps.html

Parameters:
  • index – 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 – 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 – 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 – List of fields to retrieve capabilities for. Wildcard (*) expressions are supported.

  • filters – An optional set of filters: can include +metadata,-metadata,-nested,-multifield,-parent

  • ignore_unavailable – If true, missing or closed indices are not included in the response.

  • include_empty_fields – If false, empty fields are not included in the response.

  • include_unmapped – If true, unmapped fields are included in the response.

  • index_filter – Allows to filter indices if the provided query rewrites to match_none on every shard.

  • runtime_mappings – Defines ad-hoc runtime fields in the request similar to the way it is done in search requests. These fields exist only as part of the query and take precedence over fields defined with the same name in the index mappings.

  • types – Only return results for fields that have one of the types in the list

get(*, index: str, id: str, error_trace: bool | None = None, filter_path: str | Sequence[str] | None = None, force_synthetic_source: bool | None = None, human: bool | None = None, preference: str | None = None, pretty: bool | None = None, realtime: bool | None = None, refresh: bool | None = None, routing: str | None = None, source: bool | str | Sequence[str] | None = None, source_excludes: str | Sequence[str] | None = None, source_includes: str | Sequence[str] | None = None, stored_fields: str | Sequence[str] | None = None, version: int | None = None, version_type: Literal['external', 'external_gte', 'force', 'internal'] | str | None = None) ObjectApiResponse[Any]

Returns a document.

https://www.elastic.co/guide/en/elasticsearch/reference/master/docs-get.html

Parameters:
  • index – Name of the index that contains the document.

  • id – Unique identifier of the document.

  • force_synthetic_source – Should this request force synthetic _source? Use this to test if the mapping supports synthetic _source and to get a sense of the worst case performance. Fetches with this enabled will be slower the enabling synthetic source natively in the index.

  • preference – Specifies the node or shard the operation should be performed on. Random by default.

  • realtime – If true, the request is real-time as opposed to near-real-time.

  • refresh – If true, Elasticsearch refreshes the affected shards to make this operation visible to search. If false, do nothing with refreshes.

  • routing – Target the specified primary shard.

  • source – True or false to return the _source field or not, or a list of fields to return.

  • source_excludes – A comma-separated list of source fields to exclude in the response.

  • source_includes – A comma-separated list of source fields to include in the response.

  • stored_fields – List of stored fields to return as part of a hit. If no fields are specified, no stored fields are included in the response. If this field is specified, the _source parameter defaults to false.

  • version – Explicit version number for concurrency control. The specified version must match the current version of the document for the request to succeed.

  • version_type – Specific version type: internal, external, external_gte.

get_script(*, id: str, error_trace: bool | None = None, filter_path: str | Sequence[str] | None = None, human: bool | None = None, master_timeout: Literal[0] | str | None = None, pretty: bool | None = None) ObjectApiResponse[Any]

Returns a script.

https://www.elastic.co/guide/en/elasticsearch/reference/master/modules-scripting.html

Parameters:
  • id – Identifier for the stored script or search template.

  • master_timeout – Specify timeout for connection to master

get_source(*, index: str, id: str, error_trace: bool | None = None, filter_path: str | Sequence[str] | None = None, human: bool | None = None, preference: str | None = None, pretty: bool | None = None, realtime: bool | None = None, refresh: bool | None = None, routing: str | None = None, source: bool | str | Sequence[str] | None = None, source_excludes: str | Sequence[str] | None = None, source_includes: str | Sequence[str] | None = None, stored_fields: str | Sequence[str] | None = None, version: int | None = None, version_type: Literal['external', 'external_gte', 'force', 'internal'] | str | None = None) ObjectApiResponse[Any]

Returns the source of a document.

https://www.elastic.co/guide/en/elasticsearch/reference/master/docs-get.html

Parameters:
  • index – Name of the index that contains the document.

  • id – Unique identifier of the document.

  • preference – Specifies the node or shard the operation should be performed on. Random by default.

  • realtime – Boolean) If true, the request is real-time as opposed to near-real-time.

  • refresh – If true, Elasticsearch refreshes the affected shards to make this operation visible to search. If false, do nothing with refreshes.

  • routing – Target the specified primary shard.

  • source – True or false to return the _source field or not, or a list of fields to return.

  • source_excludes – A comma-separated list of source fields to exclude in the response.

  • source_includes – A comma-separated list of source fields to include in the response.

  • stored_fields

  • version – Explicit version number for concurrency control. The specified version must match the current version of the document for the request to succeed.

  • version_type – Specific version type: internal, external, external_gte.

index(*, index: str, document: Mapping[str, Any] | None = None, body: Mapping[str, Any] | None = None, id: str | None = None, error_trace: bool | None = None, filter_path: str | Sequence[str] | None = None, human: bool | None = None, if_primary_term: int | None = None, if_seq_no: int | None = None, op_type: Literal['create', 'index'] | str | None = None, pipeline: str | None = None, pretty: bool | None = None, refresh: Literal['false', 'true', 'wait_for'] | bool | str | None = None, require_alias: bool | None = None, routing: str | None = None, timeout: Literal[0] | str | None = None, version: int | None = None, version_type: Literal['external', 'external_gte', 'force', 'internal'] | str | None = None, wait_for_active_shards: int | Literal['all', 'index-setting'] | str | None = None) ObjectApiResponse[Any]

Creates or updates a document in an index.

https://www.elastic.co/guide/en/elasticsearch/reference/master/docs-index_.html

Parameters:
  • index – Name of the data stream or index to target.

  • document

  • id – Unique identifier for the document.

  • if_primary_term – Only perform the operation if the document has this primary term.

  • if_seq_no – Only perform the operation if the document has this sequence number.

  • op_type – Set to create to only index the document if it does not already exist (put if absent). If a document with the specified _id already exists, the indexing operation will fail. Same as using the <index>/_create endpoint. Valid values: index, create. If document id is specified, it defaults to index. Otherwise, it defaults to create.

  • pipeline – ID of the pipeline to use to preprocess incoming documents. If the index has a default ingest pipeline specified, then setting the value to _none disables the default ingest pipeline for this request. If a final pipeline is configured it will always run, regardless of the value of this parameter.

  • refresh – If true, Elasticsearch refreshes the affected shards to make this operation visible to search, if wait_for then wait for a refresh to make this operation visible to search, if false do nothing with refreshes. Valid values: true, false, wait_for.

  • require_alias – If true, the destination must be an index alias.

  • routing – Custom value used to route operations to a specific shard.

  • timeout – Period the request waits for the following operations: automatic index creation, dynamic mapping updates, waiting for active shards.

  • version – Explicit version number for concurrency control. The specified version must match the current version of the document for the request to succeed.

  • version_type – Specific version type: external, external_gte.

  • wait_for_active_shards – 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).

info(*, error_trace: bool | None = None, filter_path: str | Sequence[str] | None = None, human: bool | None = None, pretty: bool | None = None) ObjectApiResponse[Any]

Returns basic information about the cluster.

https://www.elastic.co/guide/en/elasticsearch/reference/master/index.html

mget(*, index: str | None = None, docs: Sequence[Mapping[str, Any]] | None = None, error_trace: bool | None = None, filter_path: str | Sequence[str] | None = None, force_synthetic_source: bool | None = None, human: bool | None = None, ids: str | Sequence[str] | None = None, preference: str | None = None, pretty: bool | None = None, realtime: bool | None = None, refresh: bool | None = None, routing: str | None = None, source: bool | str | Sequence[str] | None = None, source_excludes: str | Sequence[str] | None = None, source_includes: str | Sequence[str] | None = None, stored_fields: str | Sequence[str] | None = None, body: Dict[str, Any] | None = None) ObjectApiResponse[Any]

Allows to get multiple documents in one request.

https://www.elastic.co/guide/en/elasticsearch/reference/master/docs-multi-get.html

Parameters:
  • index – Name of the index to retrieve documents from when ids are specified, or when a document in the docs array does not specify an index.

  • docs – The documents you want to retrieve. Required if no index is specified in the request URI.

  • force_synthetic_source – Should this request force synthetic _source? Use this to test if the mapping supports synthetic _source and to get a sense of the worst case performance. Fetches with this enabled will be slower the enabling synthetic source natively in the index.

  • ids – The IDs of the documents you want to retrieve. Allowed when the index is specified in the request URI.

  • preference – Specifies the node or shard the operation should be performed on. Random by default.

  • realtime – If true, the request is real-time as opposed to near-real-time.

  • refresh – If true, the request refreshes relevant shards before retrieving documents.

  • routing – Custom value used to route operations to a specific shard.

  • source – True or false to return the _source field or not, or a list of fields to return.

  • source_excludes – A comma-separated list of source fields to exclude from the response. You can also use this parameter to exclude fields from the subset specified in _source_includes query parameter.

  • source_includes – A comma-separated list of source fields to include in the response. If this parameter is specified, only these source fields are returned. You can exclude fields from this subset using the _source_excludes query parameter. If the _source parameter is false, this parameter is ignored.

  • stored_fields – If true, retrieves the document fields stored in the index rather than the document _source.

msearch(*, searches: Sequence[Mapping[str, Any]] | None = None, body: Sequence[Mapping[str, Any]] | None = None, index: str | Sequence[str] | None = None, allow_no_indices: bool | None = None, ccs_minimize_roundtrips: bool | None = None, error_trace: bool | None = None, expand_wildcards: Sequence[Literal['all', 'closed', 'hidden', 'none', 'open'] | str] | Literal['all', 'closed', 'hidden', 'none', 'open'] | str | None = None, filter_path: str | Sequence[str] | None = None, human: bool | None = None, ignore_throttled: bool | None = None, ignore_unavailable: bool | None = None, max_concurrent_searches: int | None = None, max_concurrent_shard_requests: int | None = None, pre_filter_shard_size: int | None = None, pretty: bool | None = None, rest_total_hits_as_int: bool | None = None, routing: str | None = None, search_type: Literal['dfs_query_then_fetch', 'query_then_fetch'] | str | None = None, typed_keys: bool | None = None) ObjectApiResponse[Any]

Allows to execute several search operations in one request.

https://www.elastic.co/guide/en/elasticsearch/reference/master/search-multi-search.html

Parameters:
  • searches

  • index – Comma-separated list of data streams, indices, and index aliases to search.

  • allow_no_indices – 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.

  • ccs_minimize_roundtrips – If true, network roundtrips between the coordinating node and remote clusters are minimized for cross-cluster search requests.

  • expand_wildcards – 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.

  • ignore_throttled – If true, concrete, expanded or aliased indices are ignored when frozen.

  • ignore_unavailable – If true, missing or closed indices are not included in the response.

  • max_concurrent_searches – Maximum number of concurrent searches the multi search API can execute.

  • max_concurrent_shard_requests – Maximum number of concurrent shard requests that each sub-search request executes per node.

  • pre_filter_shard_size – Defines a threshold that enforces a pre-filter roundtrip to prefilter search shards based on query rewriting if the number of shards the search request expands to exceeds the threshold. This filter roundtrip can limit the number of shards significantly if for instance a shard can not match any documents based on its rewrite method i.e., if date filters are mandatory to match but the shard bounds and the query are disjoint.

  • rest_total_hits_as_int – If true, hits.total are returned as an integer in the response. Defaults to false, which returns an object.

  • routing – Custom routing value used to route search operations to a specific shard.

  • search_type – Indicates whether global term and document frequencies should be used when scoring returned documents.

  • typed_keys – Specifies whether aggregation and suggester names should be prefixed by their respective types in the response.

msearch_template(*, search_templates: Sequence[Mapping[str, Any]] | None = None, body: Sequence[Mapping[str, Any]] | None = None, index: str | Sequence[str] | None = None, ccs_minimize_roundtrips: bool | None = None, error_trace: bool | None = None, filter_path: str | Sequence[str] | None = None, human: bool | None = None, max_concurrent_searches: int | None = None, pretty: bool | None = None, rest_total_hits_as_int: bool | None = None, search_type: Literal['dfs_query_then_fetch', 'query_then_fetch'] | str | None = None, typed_keys: bool | None = None) ObjectApiResponse[Any]

Allows to execute several search template operations in one request.

https://www.elastic.co/guide/en/elasticsearch/reference/master/search-multi-search.html

Parameters:
  • search_templates

  • index – Comma-separated list of data streams, indices, and aliases to search. Supports wildcards (*). To search all data streams and indices, omit this parameter or use *.

  • ccs_minimize_roundtrips – If true, network round-trips are minimized for cross-cluster search requests.

  • max_concurrent_searches – Maximum number of concurrent searches the API can run.

  • rest_total_hits_as_int – If true, the response returns hits.total as an integer. If false, it returns hits.total as an object.

  • search_type – The type of the search operation. Available options: query_then_fetch, dfs_query_then_fetch.

  • typed_keys – If true, the response prefixes aggregation and suggester names with their respective types.

mtermvectors(*, index: str | None = None, docs: Sequence[Mapping[str, Any]] | None = None, error_trace: bool | None = None, field_statistics: bool | None = None, fields: str | Sequence[str] | None = None, filter_path: str | Sequence[str] | None = None, human: bool | None = None, ids: Sequence[str] | None = None, offsets: bool | None = None, payloads: bool | None = None, positions: bool | None = None, preference: str | None = None, pretty: bool | None = None, realtime: bool | None = None, routing: str | None = None, term_statistics: bool | None = None, version: int | None = None, version_type: Literal['external', 'external_gte', 'force', 'internal'] | str | None = None, body: Dict[str, Any] | None = None) ObjectApiResponse[Any]

Returns multiple termvectors in one request.

https://www.elastic.co/guide/en/elasticsearch/reference/master/docs-multi-termvectors.html

Parameters:
  • index – Name of the index that contains the documents.

  • docs – Array of existing or artificial documents.

  • field_statistics – If true, the response includes the document count, sum of document frequencies, and sum of total term frequencies.

  • fields – Comma-separated list or wildcard expressions of fields to include in the statistics. Used as the default list unless a specific field list is provided in the completion_fields or fielddata_fields parameters.

  • ids – Simplified syntax to specify documents by their ID if they’re in the same index.

  • offsets – If true, the response includes term offsets.

  • payloads – If true, the response includes term payloads.

  • positions – If true, the response includes term positions.

  • preference – Specifies the node or shard the operation should be performed on. Random by default.

  • realtime – If true, the request is real-time as opposed to near-real-time.

  • routing – Custom value used to route operations to a specific shard.

  • term_statistics – If true, the response includes term frequency and document frequency.

  • version – If true, returns the document version as part of a hit.

  • version_type – Specific version type.

open_point_in_time(*, index: str | Sequence[str], keep_alive: Literal[0] | str, error_trace: bool | None = None, expand_wildcards: Sequence[Literal['all', 'closed', 'hidden', 'none', 'open'] | str] | Literal['all', 'closed', 'hidden', 'none', 'open'] | str | None = None, filter_path: str | Sequence[str] | None = None, human: bool | None = None, ignore_unavailable: bool | None = None, preference: str | None = None, pretty: bool | None = None, routing: str | None = None) ObjectApiResponse[Any]

Open a point in time that can be used in subsequent searches

https://www.elastic.co/guide/en/elasticsearch/reference/master/point-in-time-api.html

Parameters:
  • index – A comma-separated list of index names to open point in time; use _all or empty string to perform the operation on all indices

  • keep_alive – Extends the time to live of the corresponding point in time.

  • expand_wildcards – 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 – If false, the request returns an error if it targets a missing or closed index.

  • preference – Specifies the node or shard the operation should be performed on. Random by default.

  • routing – Custom value used to route operations to a specific shard.

ping(*, error_trace: bool | None = None, filter_path: List[str] | str | None = None, human: bool | None = None, pretty: bool | None = None) bool

Returns True if a successful response returns from the info() API, otherwise returns False. This API call can fail either at the transport layer (due to connection errors or timeouts) or from a non-2XX HTTP response (due to authentication or authorization issues).

If you want to discover why the request failed you should use the info() API.

https://www.elastic.co/guide/en/elasticsearch/reference/current/index.html

put_script(*, id: str, script: Mapping[str, Any] | None = None, context: str | None = None, error_trace: bool | None = None, filter_path: str | Sequence[str] | None = None, human: bool | None = None, master_timeout: Literal[0] | str | None = None, pretty: bool | None = None, timeout: Literal[0] | str | None = None, body: Dict[str, Any] | None = None) ObjectApiResponse[Any]

Creates or updates a script.

https://www.elastic.co/guide/en/elasticsearch/reference/master/modules-scripting.html

Parameters:
  • id – Identifier for the stored script or search template. Must be unique within the cluster.

  • script – Contains the script or search template, its parameters, and its language.

  • context – Context in which the script or search template should run. To prevent errors, the API immediately compiles the script or template in this context.

  • master_timeout – 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 – Period to wait for a response. If no response is received before the timeout expires, the request fails and returns an error.

rank_eval(*, requests: Sequence[Mapping[str, Any]] | None = None, index: str | Sequence[str] | None = None, allow_no_indices: bool | None = None, error_trace: bool | None = None, expand_wildcards: Sequence[Literal['all', 'closed', 'hidden', 'none', 'open'] | str] | Literal['all', 'closed', 'hidden', 'none', 'open'] | str | None = None, filter_path: str | Sequence[str] | None = None, human: bool | None = None, ignore_unavailable: bool | None = None, metric: Mapping[str, Any] | None = None, pretty: bool | None = None, search_type: str | None = None, body: Dict[str, Any] | None = None) ObjectApiResponse[Any]

Allows to evaluate the quality of ranked search results over a set of typical search queries

https://www.elastic.co/guide/en/elasticsearch/reference/master/search-rank-eval.html

Parameters:
  • requests – A set of typical search requests, together with their provided ratings.

  • index – Comma-separated list of data streams, indices, and index aliases used to limit the request. Wildcard (*) expressions are supported. To target all data streams and indices in a cluster, omit this parameter or use _all or *.

  • allow_no_indices – 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 – Whether to expand wildcard expression to concrete indices that are open, closed or both.

  • ignore_unavailable – If true, missing or closed indices are not included in the response.

  • metric – Definition of the evaluation metric to calculate.

  • search_type – Search operation type

reindex(*, dest: Mapping[str, Any] | None = None, source: Mapping[str, Any] | None = None, conflicts: Literal['abort', 'proceed'] | str | None = None, error_trace: bool | None = None, filter_path: str | Sequence[str] | None = None, human: bool | None = None, max_docs: int | None = None, pretty: bool | None = None, refresh: bool | None = None, requests_per_second: float | None = None, require_alias: bool | None = None, script: Mapping[str, Any] | None = None, scroll: Literal[0] | str | None = None, size: int | None = None, slices: int | Literal['auto'] | str | None = None, timeout: Literal[0] | str | None = None, wait_for_active_shards: int | Literal['all', 'index-setting'] | str | None = None, wait_for_completion: bool | None = None, body: Dict[str, Any] | None = None) ObjectApiResponse[Any]

Allows to copy documents from one index to another, optionally filtering the source documents by a query, changing the destination index settings, or fetching the documents from a remote cluster.

https://www.elastic.co/guide/en/elasticsearch/reference/master/docs-reindex.html

Parameters:
  • dest – The destination you are copying to.

  • source – The source you are copying from.

  • conflicts – Set to proceed to continue reindexing even if there are conflicts.

  • max_docs – The maximum number of documents to reindex.

  • refresh – If true, the request refreshes affected shards to make this operation visible to search.

  • requests_per_second – The throttle for this request in sub-requests per second. Defaults to no throttle.

  • require_alias – If true, the destination must be an index alias.

  • script – The script to run to update the document source or metadata when reindexing.

  • scroll – Specifies how long a consistent view of the index should be maintained for scrolled search.

  • size

  • slices – The number of slices this task should be divided into. Defaults to 1 slice, meaning the task isn’t sliced into subtasks.

  • timeout – Period each indexing waits for automatic index creation, dynamic mapping updates, and waiting for active shards.

  • wait_for_active_shards – 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).

  • wait_for_completion – If true, the request blocks until the operation is complete.

render_search_template(*, id: str | None = None, error_trace: bool | None = None, file: str | None = None, filter_path: str | Sequence[str] | None = None, human: bool | None = None, params: Mapping[str, Any] | None = None, pretty: bool | None = None, source: str | None = None, body: Dict[str, Any] | None = None) ObjectApiResponse[Any]

Allows to use the Mustache language to pre-render a search definition.

https://www.elastic.co/guide/en/elasticsearch/reference/master/render-search-template-api.html

Parameters:
  • id – ID of the search template to render. If no source is specified, this or the id request body parameter is required.

  • file

  • params – Key-value pairs used to replace Mustache variables in the template. The key is the variable name. The value is the variable value.

  • source – An inline search template. Supports the same parameters as the search API’s request body. These parameters also support Mustache variables. If no id or <templated-id> is specified, this parameter is required.

scripts_painless_execute(*, context: str | None = None, context_setup: Mapping[str, Any] | None = None, error_trace: bool | None = None, filter_path: str | Sequence[str] | None = None, human: bool | None = None, pretty: bool | None = None, script: Mapping[str, Any] | None = None, body: Dict[str, Any] | None = None) ObjectApiResponse[Any]

Allows an arbitrary script to be executed and a result to be returned

https://www.elastic.co/guide/en/elasticsearch/painless/master/painless-execute-api.html

Parameters:
  • context – The context that the script should run in.

  • context_setup – Additional parameters for the context.

  • script – The Painless script to execute.

scroll(*, scroll_id: str | None = None, error_trace: bool | None = None, filter_path: str | Sequence[str] | None = None, human: bool | None = None, pretty: bool | None = None, rest_total_hits_as_int: bool | None = None, scroll: Literal[0] | str | None = None, body: Dict[str, Any] | None = None) ObjectApiResponse[Any]

Allows to retrieve a large numbers of results from a single search request.

https://www.elastic.co/guide/en/elasticsearch/reference/master/search-request-body.html#request-body-search-scroll

Parameters:
  • scroll_id – Scroll ID of the search.

  • rest_total_hits_as_int – If true, the API response’s hit.total property is returned as an integer. If false, the API response’s hit.total property is returned as an object.

  • scroll – Period to retain the search context for scrolling.

search(*, index: str | Sequence[str] | None = None, aggregations: Mapping[str, Mapping[str, Any]] | None = None, aggs: Mapping[str, Mapping[str, Any]] | None = None, allow_no_indices: bool | None = None, allow_partial_search_results: bool | None = None, analyze_wildcard: bool | None = None, analyzer: str | None = None, batched_reduce_size: int | None = None, ccs_minimize_roundtrips: bool | None = None, collapse: Mapping[str, Any] | None = None, default_operator: Literal['and', 'or'] | str | None = None, df: str | None = None, docvalue_fields: Sequence[Mapping[str, Any]] | None = None, error_trace: bool | None = None, expand_wildcards: Sequence[Literal['all', 'closed', 'hidden', 'none', 'open'] | str] | Literal['all', 'closed', 'hidden', 'none', 'open'] | str | None = None, explain: bool | None = None, ext: Mapping[str, Any] | None = None, fields: Sequence[Mapping[str, Any]] | None = None, filter_path: str | Sequence[str] | None = None, force_synthetic_source: bool | None = None, from_: int | None = None, highlight: Mapping[str, Any] | None = None, human: bool | None = None, ignore_throttled: bool | None = None, ignore_unavailable: bool | None = None, indices_boost: Sequence[Mapping[str, float]] | None = None, knn: Mapping[str, Any] | Sequence[Mapping[str, Any]] | None = None, lenient: bool | None = None, max_concurrent_shard_requests: int | None = None, min_compatible_shard_node: str | None = None, min_score: float | None = None, pit: Mapping[str, Any] | None = None, post_filter: Mapping[str, Any] | None = None, pre_filter_shard_size: int | None = None, preference: str | None = None, pretty: bool | None = None, profile: bool | None = None, q: str | None = None, query: Mapping[str, Any] | None = None, rank: Mapping[str, Any] | None = None, request_cache: bool | None = None, rescore: Mapping[str, Any] | Sequence[Mapping[str, Any]] | None = None, rest_total_hits_as_int: bool | None = None, routing: str | None = None, runtime_mappings: Mapping[str, Mapping[str, Any]] | None = None, script_fields: Mapping[str, Mapping[str, Any]] | None = None, scroll: Literal[0] | str | None = None, search_after: Sequence[None | bool | float | int | str | Any] | None = None, search_type: Literal['dfs_query_then_fetch', 'query_then_fetch'] | str | None = None, seq_no_primary_term: bool | None = None, size: int | None = None, slice: Mapping[str, Any] | None = None, sort: Sequence[str | Mapping[str, Any]] | str | Mapping[str, Any] | None = None, source: bool | Mapping[str, Any] | None = None, source_excludes: str | Sequence[str] | None = None, source_includes: str | Sequence[str] | None = None, stats: Sequence[str] | None = None, stored_fields: str | Sequence[str] | None = None, suggest: Mapping[str, Any] | None = None, suggest_field: str | None = None, suggest_mode: Literal['always', 'missing', 'popular'] | str | None = None, suggest_size: int | None = None, suggest_text: str | None = None, terminate_after: int | None = None, timeout: str | None = None, track_scores: bool | None = None, track_total_hits: bool | int | None = None, typed_keys: bool | None = None, version: bool | None = None, body: Dict[str, Any] | None = None) ObjectApiResponse[Any]

Returns results matching a query.

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

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

  • aggregations – Defines the aggregations that are run as part of the search request.

  • aggs – Defines the aggregations that are run as part of the search request.

  • allow_no_indices – 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.

  • allow_partial_search_results – If true, returns partial results if there are shard request timeouts or shard failures. If false, returns an error with no partial results.

  • analyze_wildcard – If true, wildcard and prefix queries are analyzed. This parameter can only be used when the q query string parameter is specified.

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

  • batched_reduce_size – The number of shard results that should be reduced at once on the coordinating node. This value should be used as a protection mechanism to reduce the memory overhead per search request if the potential number of shards in the request can be large.

  • ccs_minimize_roundtrips – If true, network round-trips between the coordinating node and the remote clusters are minimized when executing cross-cluster search (CCS) requests.

  • collapse – Collapses search results the values of the specified field.

  • default_operator – The default operator for query string query: AND or OR. This parameter can only be used when the q query string parameter is specified.

  • df – 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.

  • docvalue_fields – Array of wildcard (*) patterns. The request returns doc values for field names matching these patterns in the hits.fields property of the response.

  • expand_wildcards – 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.

  • explain – If true, returns detailed information about score computation as part of a hit.

  • ext – Configuration of search extensions defined by Elasticsearch plugins.

  • fields – Array of wildcard (*) patterns. The request returns values for field names matching these patterns in the hits.fields property of the response.

  • force_synthetic_source – Should this request force synthetic _source? Use this to test if the mapping supports synthetic _source and to get a sense of the worst case performance. Fetches with this enabled will be slower the enabling synthetic source natively in the index.

  • from – Starting document offset. Needs to be non-negative. By default, you cannot page through more than 10,000 hits using the from and size parameters. To page through more hits, use the search_after parameter.

  • highlight – Specifies the highlighter to use for retrieving highlighted snippets from one or more fields in your search results.

  • ignore_throttled – If true, concrete, expanded or aliased indices will be ignored when frozen.

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

  • indices_boost – Boosts the _score of documents from specified indices.

  • knn – Defines the approximate kNN search to run.

  • lenient – If true, format-based query failures (such as providing text to a numeric field) in the query string will be ignored. This parameter can only be used when the q query string parameter is specified.

  • max_concurrent_shard_requests – Defines the number of concurrent shard requests per node this search executes concurrently. This value should be used to limit the impact of the search on the cluster in order to limit the number of concurrent shard requests.

  • min_compatible_shard_node – The minimum version of the node that can handle the request Any handling node with a lower version will fail the request.

  • min_score – Minimum _score for matching documents. Documents with a lower _score are not included in the search results.

  • pit – Limits the search to a point in time (PIT). If you provide a PIT, you cannot specify an <index> in the request path.

  • post_filter – Use the post_filter parameter to filter search results. The search hits are filtered after the aggregations are calculated. A post filter has no impact on the aggregation results.

  • pre_filter_shard_size – Defines a threshold that enforces a pre-filter roundtrip to prefilter search shards based on query rewriting if the number of shards the search request expands to exceeds the threshold. This filter roundtrip can limit the number of shards significantly if for instance a shard can not match any documents based on its rewrite method (if date filters are mandatory to match but the shard bounds and the query are disjoint). When unspecified, the pre-filter phase is executed if any of these conditions is met: the request targets more than 128 shards; the request targets one or more read-only index; the primary sort of the query targets an indexed field.

  • preference – Nodes and shards used for the search. By default, Elasticsearch selects from eligible nodes and shards using adaptive replica selection, accounting for allocation awareness. Valid values are: _only_local to run the search only on shards on the local node; _local to, if possible, run the search on shards on the local node, or if not, select shards using the default method; _only_nodes:<node-id>,<node-id> to run the search on only the specified nodes IDs, where, if suitable shards exist on more than one selected node, use shards on those nodes using the default method, or if none of the specified nodes are available, select shards from any available node using the default method; _prefer_nodes:<node-id>,<node-id> to if possible, run the search on the specified nodes IDs, or if not, select shards using the default method; _shards:<shard>,<shard> to run the search only on the specified shards; <custom-string> (any string that does not start with _) to route searches with the same <custom-string> to the same shards in the same order.

  • profile – Set to true to return detailed timing information about the execution of individual components in a search request. NOTE: This is a debugging tool and adds significant overhead to search execution.

  • q – Query in the Lucene query string syntax using query parameter search. Query parameter searches do not support the full Elasticsearch Query DSL but are handy for testing.

  • query – Defines the search definition using the Query DSL.

  • rank – Defines the Reciprocal Rank Fusion (RRF) to use.

  • request_cache – If true, the caching of search results is enabled for requests where size is 0. Defaults to index level settings.

  • rescore – Can be used to improve precision by reordering just the top (for example 100 - 500) documents returned by the query and post_filter phases.

  • rest_total_hits_as_int – Indicates whether hits.total should be rendered as an integer or an object in the rest search response.

  • routing – Custom value used to route operations to a specific shard.

  • runtime_mappings – Defines one or more runtime fields in the search request. These fields take precedence over mapped fields with the same name.

  • script_fields – Retrieve a script evaluation (based on different fields) for each hit.

  • scroll – Period to retain the search context for scrolling. See Scroll search results. By default, this value cannot exceed 1d (24 hours). You can change this limit using the search.max_keep_alive cluster-level setting.

  • search_after – Used to retrieve the next page of hits using a set of sort values from the previous page.

  • search_type – How distributed term frequencies are calculated for relevance scoring.

  • seq_no_primary_term – If true, returns sequence number and primary term of the last modification of each hit.

  • size – The number of hits to return. By default, you cannot page through more than 10,000 hits using the from and size parameters. To page through more hits, use the search_after parameter.

  • slice – Can be used to split a scrolled search into multiple slices that can be consumed independently.

  • sort – A comma-separated list of <field>:<direction> pairs.

  • source – Indicates which source fields are returned for matching documents. These fields are returned in the hits._source property of the search response.

  • source_excludes – A comma-separated list of source fields to exclude from the response. You can also use this parameter to exclude fields from the subset specified in _source_includes query parameter. If the _source parameter is false, this parameter is ignored.

  • source_includes – A comma-separated list of source fields to include in the response. If this parameter is specified, only these source fields are returned. You can exclude fields from this subset using the _source_excludes query parameter. If the _source parameter is false, this parameter is ignored.

  • stats – Stats groups to associate with the search. Each group maintains a statistics aggregation for its associated searches. You can retrieve these stats using the indices stats API.

  • stored_fields – List of stored fields to return as part of a hit. If no fields are specified, no stored fields are included in the response. If this field is specified, the _source parameter defaults to false. You can pass _source: true to return both source fields and stored fields in the search response.

  • suggest – Defines a suggester that provides similar looking terms based on a provided text.

  • suggest_field – Specifies which field to use for suggestions.

  • suggest_mode – Specifies the suggest mode. This parameter can only be used when the suggest_field and suggest_text query string parameters are specified.

  • suggest_size – Number of suggestions to return. This parameter can only be used when the suggest_field and suggest_text query string parameters are specified.

  • suggest_text – The source text for which the suggestions should be returned. This parameter can only be used when the suggest_field and suggest_text query string parameters are specified.

  • terminate_after – Maximum number of documents to collect for each shard. If a query reaches this limit, Elasticsearch terminates the query early. Elasticsearch collects documents before sorting. Use with caution. Elasticsearch applies this parameter to each shard handling the request. When possible, let Elasticsearch perform early termination automatically. Avoid specifying this parameter for requests that target data streams with backing indices across multiple data tiers. If set to 0 (default), the query does not terminate early.

  • timeout – Specifies the period of time to wait for a response from each shard. If no response is received before the timeout expires, the request fails and returns an error. Defaults to no timeout.

  • track_scores – If true, calculate and return document scores, even if the scores are not used for sorting.

  • track_total_hits – Number of hits matching the query to count accurately. If true, the exact number of hits is returned at the cost of some performance. If false, the response does not include the total number of hits matching the query.

  • typed_keys – If true, aggregation and suggester names are be prefixed by their respective types in the response.

  • version – If true, returns document version as part of a hit.

search_mvt(*, index: str | Sequence[str], field: str, zoom: int, x: int, y: int, aggs: Mapping[str, Mapping[str, Any]] | None = None, buffer: int | None = None, error_trace: bool | None = None, exact_bounds: bool | None = None, extent: int | None = None, fields: str | Sequence[str] | None = None, filter_path: str | Sequence[str] | None = None, grid_agg: Literal['geohex', 'geotile'] | str | None = None, grid_precision: int | None = None, grid_type: Literal['centroid', 'grid', 'point'] | str | None = None, human: bool | None = None, pretty: bool | None = None, query: Mapping[str, Any] | None = None, runtime_mappings: Mapping[str, Mapping[str, Any]] | None = None, size: int | None = None, sort: Sequence[str | Mapping[str, Any]] | str | Mapping[str, Any] | None = None, track_total_hits: bool | int | None = None, with_labels: bool | None = None, body: Dict[str, Any] | None = None) BinaryApiResponse

Searches a vector tile for geospatial values. Returns results as a binary Mapbox vector tile.

https://www.elastic.co/guide/en/elasticsearch/reference/master/search-vector-tile-api.html

Parameters:
  • index – Comma-separated list of data streams, indices, or aliases to search

  • field – Field containing geospatial data to return

  • zoom – Zoom level for the vector tile to search

  • x – X coordinate for the vector tile to search

  • y – Y coordinate for the vector tile to search

  • aggs – Sub-aggregations for the geotile_grid. Supports the following aggregation types: - avg - cardinality - max - min - sum

  • buffer – Size, in pixels, of a clipping buffer outside the tile. This allows renderers to avoid outline artifacts from geometries that extend past the extent of the tile.

  • exact_bounds – If false, the meta layer’s feature is the bounding box of the tile. If true, the meta layer’s feature is a bounding box resulting from a geo_bounds aggregation. The aggregation runs on <field> values that intersect the <zoom>/<x>/<y> tile with wrap_longitude set to false. The resulting bounding box may be larger than the vector tile.

  • extent – Size, in pixels, of a side of the tile. Vector tiles are square with equal sides.

  • fields – Fields to return in the hits layer. Supports wildcards (*). This parameter does not support fields with array values. Fields with array values may return inconsistent results.

  • grid_agg – Aggregation used to create a grid for the field.

  • grid_precision – Additional zoom levels available through the aggs layer. For example, if <zoom> is 7 and grid_precision is 8, you can zoom in up to level 15. Accepts 0-8. If 0, results don’t include the aggs layer.

  • grid_type – Determines the geometry type for features in the aggs layer. In the aggs layer, each feature represents a geotile_grid cell. If ‘grid’ each feature is a Polygon of the cells bounding box. If ‘point’ each feature is a Point that is the centroid of the cell.

  • query – Query DSL used to filter documents for the search.

  • runtime_mappings – Defines one or more runtime fields in the search request. These fields take precedence over mapped fields with the same name.

  • size – Maximum number of features to return in the hits layer. Accepts 0-10000. If 0, results don’t include the hits layer.

  • sort – Sorts features in the hits layer. By default, the API calculates a bounding box for each feature. It sorts features based on this box’s diagonal length, from longest to shortest.

  • track_total_hits – Number of hits matching the query to count accurately. If true, the exact number of hits is returned at the cost of some performance. If false, the response does not include the total number of hits matching the query.

  • with_labels – If true, the hits and aggs layers will contain additional point features representing suggested label positions for the original features.

search_template(*, index: str | Sequence[str] | None = None, allow_no_indices: bool | None = None, ccs_minimize_roundtrips: bool | None = None, error_trace: bool | None = None, expand_wildcards: Sequence[Literal['all', 'closed', 'hidden', 'none', 'open'] | str] | Literal['all', 'closed', 'hidden', 'none', 'open'] | str | None = None, explain: bool | None = None, filter_path: str | Sequence[str] | None = None, human: bool | None = None, id: str | None = None, ignore_throttled: bool | None = None, ignore_unavailable: bool | None = None, params: Mapping[str, Any] | None = None, preference: str | None = None, pretty: bool | None = None, profile: bool | None = None, rest_total_hits_as_int: bool | None = None, routing: str | None = None, scroll: Literal[0] | str | None = None, search_type: Literal['dfs_query_then_fetch', 'query_then_fetch'] | str | None = None, source: str | None = None, typed_keys: bool | None = None, body: Dict[str, Any] | None = None) ObjectApiResponse[Any]

Allows to use the Mustache language to pre-render a search definition.

https://www.elastic.co/guide/en/elasticsearch/reference/master/search-template.html

Parameters:
  • index – Comma-separated list of data streams, indices, and aliases to search. Supports wildcards (*).

  • allow_no_indices – 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.

  • ccs_minimize_roundtrips – If true, network round-trips are minimized for cross-cluster search requests.

  • expand_wildcards – 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 – If true, returns detailed information about score calculation as part of each hit.

  • id – ID of the search template to use. If no source is specified, this parameter is required.

  • ignore_throttled – If true, specified concrete, expanded, or aliased indices are not included in the response when throttled.

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

  • params – Key-value pairs used to replace Mustache variables in the template. The key is the variable name. The value is the variable value.

  • preference – Specifies the node or shard the operation should be performed on. Random by default.

  • profile – If true, the query execution is profiled.

  • rest_total_hits_as_int – If true, hits.total are rendered as an integer in the response.

  • routing – Custom value used to route operations to a specific shard.

  • scroll – Specifies how long a consistent view of the index should be maintained for scrolled search.

  • search_type – The type of the search operation.

  • source – An inline search template. Supports the same parameters as the search API’s request body. Also supports Mustache variables. If no id is specified, this parameter is required.

  • typed_keys – If true, the response prefixes aggregation and suggester names with their respective types.

terms_enum(*, index: str, field: str | None = None, case_insensitive: bool | None = None, error_trace: bool | None = None, filter_path: str | Sequence[str] | None = None, human: bool | None = None, index_filter: Mapping[str, Any] | None = None, pretty: bool | None = None, search_after: str | None = None, size: int | None = None, string: str | None = None, timeout: Literal[0] | str | None = None, body: Dict[str, Any] | None = None) ObjectApiResponse[Any]

The terms enum API can be used to discover terms in the index that begin with the provided string. It is designed for low-latency look-ups used in auto-complete scenarios.

https://www.elastic.co/guide/en/elasticsearch/reference/master/search-terms-enum.html

Parameters:
  • index – Comma-separated list of data streams, indices, and index aliases to search. Wildcard (*) expressions are supported.

  • field – The string to match at the start of indexed terms. If not provided, all terms in the field are considered.

  • case_insensitive – When true the provided search string is matched against index terms without case sensitivity.

  • index_filter – Allows to filter an index shard if the provided query rewrites to match_none.

  • search_after

  • size – How many matching terms to return.

  • string – The string after which terms in the index should be returned. Allows for a form of pagination if the last result from one request is passed as the search_after parameter for a subsequent request.

  • timeout – The maximum length of time to spend collecting results. Defaults to “1s” (one second). If the timeout is exceeded the complete flag set to false in the response and the results may be partial or empty.

termvectors(*, index: str, id: str | None = None, doc: Mapping[str, Any] | None = None, error_trace: bool | None = None, field_statistics: bool | None = None, fields: str | Sequence[str] | None = None, filter: Mapping[str, Any] | None = None, filter_path: str | Sequence[str] | None = None, human: bool | None = None, offsets: bool | None = None, payloads: bool | None = None, per_field_analyzer: Mapping[str, str] | None = None, positions: bool | None = None, preference: str | None = None, pretty: bool | None = None, realtime: bool | None = None, routing: str | None = None, term_statistics: bool | None = None, version: int | None = None, version_type: Literal['external', 'external_gte', 'force', 'internal'] | str | None = None, body: Dict[str, Any] | None = None) ObjectApiResponse[Any]

Returns information and statistics about terms in the fields of a particular document.

https://www.elastic.co/guide/en/elasticsearch/reference/master/docs-termvectors.html

Parameters:
  • index – Name of the index that contains the document.

  • id – Unique identifier of the document.

  • doc – An artificial document (a document not present in the index) for which you want to retrieve term vectors.

  • field_statistics – If true, the response includes the document count, sum of document frequencies, and sum of total term frequencies.

  • fields – Comma-separated list or wildcard expressions of fields to include in the statistics. Used as the default list unless a specific field list is provided in the completion_fields or fielddata_fields parameters.

  • filter – Filter terms based on their tf-idf scores.

  • offsets – If true, the response includes term offsets.

  • payloads – If true, the response includes term payloads.

  • per_field_analyzer – Overrides the default per-field analyzer.

  • positions – If true, the response includes term positions.

  • preference – Specifies the node or shard the operation should be performed on. Random by default.

  • realtime – If true, the request is real-time as opposed to near-real-time.

  • routing – Custom value used to route operations to a specific shard.

  • term_statistics – If true, the response includes term frequency and document frequency.

  • version – If true, returns the document version as part of a hit.

  • version_type – Specific version type.

update(*, index: str, id: str, detect_noop: bool | None = None, doc: Mapping[str, Any] | None = None, doc_as_upsert: bool | None = None, error_trace: bool | None = None, filter_path: str | Sequence[str] | None = None, human: bool | None = None, if_primary_term: int | None = None, if_seq_no: int | None = None, lang: str | None = None, pretty: bool | None = None, refresh: Literal['false', 'true', 'wait_for'] | bool | str | None = None, require_alias: bool | None = None, retry_on_conflict: int | None = None, routing: str | None = None, script: Mapping[str, Any] | None = None, scripted_upsert: bool | None = None, source: bool | Mapping[str, Any] | None = None, source_excludes: str | Sequence[str] | None = None, source_includes: str | Sequence[str] | None = None, timeout: Literal[0] | str | None = None, upsert: Mapping[str, Any] | None = None, wait_for_active_shards: int | Literal['all', 'index-setting'] | str | None = None, body: Dict[str, Any] | None = None) ObjectApiResponse[Any]

Updates a document with a script or partial document.

https://www.elastic.co/guide/en/elasticsearch/reference/master/docs-update.html

Parameters:
  • index – The name of the index

  • id – Document ID

  • detect_noop – Set to false to disable setting ‘result’ in the response to ‘noop’ if no change to the document occurred.

  • doc – A partial update to an existing document.

  • doc_as_upsert – Set to true to use the contents of ‘doc’ as the value of ‘upsert’

  • if_primary_term – Only perform the operation if the document has this primary term.

  • if_seq_no – Only perform the operation if the document has this sequence number.

  • lang – The script language.

  • refresh – If ‘true’, Elasticsearch refreshes the affected shards to make this operation visible to search, if ‘wait_for’ then wait for a refresh to make this operation visible to search, if ‘false’ do nothing with refreshes.

  • require_alias – If true, the destination must be an index alias.

  • retry_on_conflict – Specify how many times should the operation be retried when a conflict occurs.

  • routing – Custom value used to route operations to a specific shard.

  • script – Script to execute to update the document.

  • scripted_upsert – Set to true to execute the script whether or not the document exists.

  • source – Set to false to disable source retrieval. You can also specify a comma-separated list of the fields you want to retrieve.

  • source_excludes – Specify the source fields you want to exclude.

  • source_includes – Specify the source fields you want to retrieve.

  • timeout – Period to wait for dynamic mapping updates and active shards. This guarantees Elasticsearch waits for at least the timeout before failing. The actual wait time could be longer, particularly when multiple waits occur.

  • upsert – If the document does not already exist, the contents of ‘upsert’ are inserted as a new document. If the document exists, the ‘script’ is executed.

  • wait_for_active_shards – The number of shard copies that must be active before proceeding with the operations. Set to ‘all’ or any positive integer up to the total number of shards in the index (number_of_replicas+1). Defaults to 1 meaning the primary shard.

update_by_query(*, index: str | Sequence[str], allow_no_indices: bool | None = None, analyze_wildcard: bool | None = None, analyzer: str | None = None, conflicts: Literal['abort', 'proceed'] | str | None = None, default_operator: Literal['and', 'or'] | str | None = None, df: str | None = None, error_trace: bool | None = None, expand_wildcards: Sequence[Literal['all', 'closed', 'hidden', 'none', 'open'] | str] | Literal['all', 'closed', 'hidden', 'none', 'open'] | str | None = None, filter_path: str | Sequence[str] | None = None, from_: int | None = None, human: bool | None = None, ignore_unavailable: bool | None = None, lenient: bool | None = None, max_docs: int | None = None, pipeline: str | None = None, preference: str | None = None, pretty: bool | None = None, query: Mapping[str, Any] | None = None, refresh: bool | None = None, request_cache: bool | None = None, requests_per_second: float | None = None, routing: str | None = None, script: Mapping[str, Any] | None = None, scroll: Literal[0] | str | None = None, scroll_size: int | None = None, search_timeout: Literal[0] | str | None = None, search_type: Literal['dfs_query_then_fetch', 'query_then_fetch'] | str | None = None, slice: Mapping[str, Any] | None = None, slices: int | Literal['auto'] | str | None = None, sort: Sequence[str] | None = None, stats: Sequence[str] | None = None, terminate_after: int | None = None, timeout: Literal[0] | str | None = None, version: bool | None = None, version_type: bool | None = None, wait_for_active_shards: int | Literal['all', 'index-setting'] | str | None = None, wait_for_completion: bool | None = None, body: Dict[str, Any] | None = None) ObjectApiResponse[Any]

Updates documents that match the specified query. If no query is specified, performs an update on every document in the index without changing the source, for example to pick up a mapping change.

https://www.elastic.co/guide/en/elasticsearch/reference/master/docs-update-by-query.html

Parameters:
  • index – 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.

  • allow_no_indices – 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.

  • analyze_wildcard – If true, wildcard and prefix queries are analyzed.

  • analyzer – Analyzer to use for the query string.

  • conflicts – What to do if update by query hits version conflicts: abort or proceed.

  • default_operator – The default operator for query string query: AND or OR.

  • df – Field to use as default where no field prefix is given in the query string.

  • expand_wildcards – 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.

  • from – Starting offset (default: 0)

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

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

  • max_docs – The maximum number of documents to update.

  • pipeline – ID of the pipeline to use to preprocess incoming documents. If the index has a default ingest pipeline specified, then setting the value to _none disables the default ingest pipeline for this request. If a final pipeline is configured it will always run, regardless of the value of this parameter.

  • preference – Specifies the node or shard the operation should be performed on. Random by default.

  • query – Specifies the documents to update using the Query DSL.

  • refresh – If true, Elasticsearch refreshes affected shards to make the operation visible to search.

  • request_cache – If true, the request cache is used for this request.

  • requests_per_second – The throttle for this request in sub-requests per second.

  • routing – Custom value used to route operations to a specific shard.

  • script – The script to run to update the document source or metadata when updating.

  • scroll – Period to retain the search context for scrolling.

  • scroll_size – Size of the scroll request that powers the operation.

  • search_timeout – Explicit timeout for each search request.

  • search_type – The type of the search operation. Available options: query_then_fetch, dfs_query_then_fetch.

  • slice – Slice the request manually using the provided slice ID and total number of slices.

  • slices – The number of slices this task should be divided into.

  • sort – A comma-separated list of <field>:<direction> pairs.

  • stats – Specific tag of the request for logging and statistical purposes.

  • terminate_after – Maximum number of documents to collect for each shard. If a query reaches this limit, Elasticsearch terminates the query early. Elasticsearch collects documents before sorting. Use with caution. Elasticsearch applies this parameter to each shard handling the request. When possible, let Elasticsearch perform early termination automatically. Avoid specifying this parameter for requests that target data streams with backing indices across multiple data tiers.

  • timeout – Period each update request waits for the following operations: dynamic mapping updates, waiting for active shards.

  • version – If true, returns the document version as part of a hit.

  • version_type – Should the document increment the version number (internal) on hit or not (reindex)

  • wait_for_active_shards – 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).

  • wait_for_completion – If true, the request blocks until the operation is complete.

Cat

class elasticsearch_serverless.client.CatClient(client: BaseClient)
aliases(*, name: str | Sequence[str] | None = None, error_trace: bool | None = None, expand_wildcards: Sequence[Literal['all', 'closed', 'hidden', 'none', 'open'] | str] | Literal['all', 'closed', 'hidden', 'none', 'open'] | str | None = None, filter_path: str | Sequence[str] | None = None, format: str | None = None, h: str | Sequence[str] | None = None, help: bool | None = None, human: bool | None = None, local: bool | None = None, master_timeout: Literal[0] | str | None = None, pretty: bool | None = None, s: str | Sequence[str] | None = None, v: bool | None = None) ObjectApiResponse[Any] | TextApiResponse

Shows information about currently configured aliases to indices including filter and routing infos.

https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-alias.html

Parameters:
  • name – A comma-separated list of aliases to retrieve. Supports wildcards (*). To retrieve all aliases, omit this parameter or use * or _all.

  • expand_wildcards – Whether to expand wildcard expression to concrete indices that are open, closed or both.

  • format – Specifies the format to return the columnar data in, can be set to text, json, cbor, yaml, or smile.

  • h – List of columns to appear in the response. Supports simple wildcards.

  • help – When set to true will output available columns. This option can’t be combined with any other query string option.

  • local – If true, the request computes the list of selected nodes from the local cluster state. If false the list of selected nodes are computed from the cluster state of the master node. In both cases the coordinating node will send requests for further information to each selected node.

  • master_timeout – Period to wait for a connection to the master node.

  • s – List of columns that determine how the table should be sorted. Sorting defaults to ascending and can be changed by setting :asc or :desc as a suffix to the column name.

  • v – When set to true will enable verbose output.

component_templates(*, name: str | None = None, error_trace: bool | None = None, filter_path: str | Sequence[str] | None = None, format: str | None = None, h: str | Sequence[str] | None = None, help: bool | None = None, human: bool | None = None, local: bool | None = None, master_timeout: Literal[0] | str | None = None, pretty: bool | None = None, s: str | Sequence[str] | None = None, v: bool | None = None) ObjectApiResponse[Any] | TextApiResponse

Returns information about existing component_templates templates.

https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-component-templates.html

Parameters:
  • name – The name of the component template. Accepts wildcard expressions. If omitted, all component templates are returned.

  • format – Specifies the format to return the columnar data in, can be set to text, json, cbor, yaml, or smile.

  • h – List of columns to appear in the response. Supports simple wildcards.

  • help – When set to true will output available columns. This option can’t be combined with any other query string option.

  • local – If true, the request computes the list of selected nodes from the local cluster state. If false the list of selected nodes are computed from the cluster state of the master node. In both cases the coordinating node will send requests for further information to each selected node.

  • master_timeout – Period to wait for a connection to the master node.

  • s – List of columns that determine how the table should be sorted. Sorting defaults to ascending and can be changed by setting :asc or :desc as a suffix to the column name.

  • v – When set to true will enable verbose output.

count(*, index: str | Sequence[str] | None = None, error_trace: bool | None = None, filter_path: str | Sequence[str] | None = None, format: str | None = None, h: str | Sequence[str] | None = None, help: bool | None = None, human: bool | None = None, local: bool | None = None, master_timeout: Literal[0] | str | None = None, pretty: bool | None = None, s: str | Sequence[str] | None = None, v: bool | None = None) ObjectApiResponse[Any] | TextApiResponse

Provides quick access to the document count of the entire cluster, or individual indices.

https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-count.html

Parameters:
  • index – 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.

  • format – Specifies the format to return the columnar data in, can be set to text, json, cbor, yaml, or smile.

  • h – List of columns to appear in the response. Supports simple wildcards.

  • help – When set to true will output available columns. This option can’t be combined with any other query string option.

  • local – If true, the request computes the list of selected nodes from the local cluster state. If false the list of selected nodes are computed from the cluster state of the master node. In both cases the coordinating node will send requests for further information to each selected node.

  • master_timeout – Period to wait for a connection to the master node.

  • s – List of columns that determine how the table should be sorted. Sorting defaults to ascending and can be changed by setting :asc or :desc as a suffix to the column name.

  • v – When set to true will enable verbose output.

help(*, error_trace: bool | None = None, filter_path: str | Sequence[str] | None = None, format: str | None = None, h: str | Sequence[str] | None = None, help: bool | None = None, human: bool | None = None, local: bool | None = None, master_timeout: Literal[0] | str | None = None, pretty: bool | None = None, s: str | Sequence[str] | None = None, v: bool | None = None) TextApiResponse

Returns help for the Cat APIs.

https://www.elastic.co/guide/en/elasticsearch/reference/master/cat.html

Parameters:
  • format – Specifies the format to return the columnar data in, can be set to text, json, cbor, yaml, or smile.

  • h – List of columns to appear in the response. Supports simple wildcards.

  • help – When set to true will output available columns. This option can’t be combined with any other query string option.

  • local – If true, the request computes the list of selected nodes from the local cluster state. If false the list of selected nodes are computed from the cluster state of the master node. In both cases the coordinating node will send requests for further information to each selected node.

  • master_timeout – Period to wait for a connection to the master node.

  • s – List of columns that determine how the table should be sorted. Sorting defaults to ascending and can be changed by setting :asc or :desc as a suffix to the column name.

  • v – When set to true will enable verbose output.

indices(*, index: str | Sequence[str] | None = None, bytes: Literal['b', 'gb', 'kb', 'mb', 'pb', 'tb'] | str | None = None, error_trace: bool | None = None, expand_wildcards: Sequence[Literal['all', 'closed', 'hidden', 'none', 'open'] | str] | Literal['all', 'closed', 'hidden', 'none', 'open'] | str | None = None, filter_path: str | Sequence[str] | None = None, format: str | None = None, h: str | Sequence[str] | None = None, health: Literal['green', 'red', 'yellow'] | str | None = None, help: bool | None = None, human: bool | None = None, include_unloaded_segments: bool | None = None, local: bool | None = None, master_timeout: Literal[0] | str | None = None, pretty: bool | None = None, pri: bool | None = None, s: str | Sequence[str] | None = None, time: Literal['d', 'h', 'm', 'micros', 'ms', 'nanos', 's'] | str | None = None, v: bool | None = None) ObjectApiResponse[Any] | TextApiResponse

Returns information about indices: number of primaries and replicas, document counts, disk size, …

https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-indices.html

Parameters:
  • index – 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.

  • bytes – The unit used to display byte values.

  • expand_wildcards – The type of index that wildcard patterns can match.

  • format – Specifies the format to return the columnar data in, can be set to text, json, cbor, yaml, or smile.

  • h – List of columns to appear in the response. Supports simple wildcards.

  • health – The health status used to limit returned indices. By default, the response includes indices of any health status.

  • help – When set to true will output available columns. This option can’t be combined with any other query string option.

  • include_unloaded_segments – If true, the response includes information from segments that are not loaded into memory.

  • local – If true, the request computes the list of selected nodes from the local cluster state. If false the list of selected nodes are computed from the cluster state of the master node. In both cases the coordinating node will send requests for further information to each selected node.

  • master_timeout – Period to wait for a connection to the master node.

  • pri – If true, the response only includes information from primary shards.

  • s – List of columns that determine how the table should be sorted. Sorting defaults to ascending and can be changed by setting :asc or :desc as a suffix to the column name.

  • time – The unit used to display time values.

  • v – When set to true will enable verbose output.

ml_data_frame_analytics(*, id: str | None = None, allow_no_match: bool | None = None, bytes: Literal['b', 'gb', 'kb', 'mb', 'pb', 'tb'] | str | None = None, error_trace: bool | None = None, filter_path: str | Sequence[str] | None = None, format: str | None = None, h: Sequence[Literal['assignment_explanation', 'create_time', 'description', 'dest_index', 'failure_reason', 'id', 'model_memory_limit', 'node.address', 'node.ephemeral_id', 'node.id', 'node.name', 'progress', 'source_index', 'state', 'type', 'version'] | str] | Literal['assignment_explanation', 'create_time', 'description', 'dest_index', 'failure_reason', 'id', 'model_memory_limit', 'node.address', 'node.ephemeral_id', 'node.id', 'node.name', 'progress', 'source_index', 'state', 'type', 'version'] | str | None = None, help: bool | None = None, human: bool | None = None, local: bool | None = None, master_timeout: Literal[0] | str | None = None, pretty: bool | None = None, s: Sequence[Literal['assignment_explanation', 'create_time', 'description', 'dest_index', 'failure_reason', 'id', 'model_memory_limit', 'node.address', 'node.ephemeral_id', 'node.id', 'node.name', 'progress', 'source_index', 'state', 'type', 'version'] | str] | Literal['assignment_explanation', 'create_time', 'description', 'dest_index', 'failure_reason', 'id', 'model_memory_limit', 'node.address', 'node.ephemeral_id', 'node.id', 'node.name', 'progress', 'source_index', 'state', 'type', 'version'] | str | None = None, time: Literal[0] | str | None = None, v: bool | None = None) ObjectApiResponse[Any] | TextApiResponse

Gets configuration and usage information about data frame analytics jobs.

https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-dfanalytics.html

Parameters:
  • id – The ID of the data frame analytics to fetch

  • allow_no_match – Whether to ignore if a wildcard expression matches no configs. (This includes _all string or when no configs have been specified)

  • bytes – The unit in which to display byte values

  • format – Specifies the format to return the columnar data in, can be set to text, json, cbor, yaml, or smile.

  • h – Comma-separated list of column names to display.

  • help – When set to true will output available columns. This option can’t be combined with any other query string option.

  • local – If true, the request computes the list of selected nodes from the local cluster state. If false the list of selected nodes are computed from the cluster state of the master node. In both cases the coordinating node will send requests for further information to each selected node.

  • master_timeout – Period to wait for a connection to the master node.

  • s – Comma-separated list of column names or column aliases used to sort the response.

  • time – Unit used to display time values.

  • v – When set to true will enable verbose output.

ml_datafeeds(*, datafeed_id: str | None = None, allow_no_match: bool | None = None, error_trace: bool | None = None, filter_path: str | Sequence[str] | None = None, format: str | None = None, h: Sequence[Literal['ae', 'bc', 'id', 'na', 'ne', 'ni', 'nn', 's', 'sba', 'sc', 'seah', 'st'] | str] | Literal['ae', 'bc', 'id', 'na', 'ne', 'ni', 'nn', 's', 'sba', 'sc', 'seah', 'st'] | str | None = None, help: bool | None = None, human: bool | None = None, local: bool | None = None, master_timeout: Literal[0] | str | None = None, pretty: bool | None = None, s: Sequence[Literal['ae', 'bc', 'id', 'na', 'ne', 'ni', 'nn', 's', 'sba', 'sc', 'seah', 'st'] | str] | Literal['ae', 'bc', 'id', 'na', 'ne', 'ni', 'nn', 's', 'sba', 'sc', 'seah', 'st'] | str | None = None, time: Literal['d', 'h', 'm', 'micros', 'ms', 'nanos', 's'] | str | None = None, v: bool | None = None) ObjectApiResponse[Any] | TextApiResponse

Gets configuration and usage information about datafeeds.

https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-datafeeds.html

Parameters:
  • datafeed_id – A numerical character string that uniquely identifies the datafeed.

  • allow_no_match – Specifies what to do when the request: * Contains wildcard expressions and there are no datafeeds that match. * Contains the _all string or no identifiers and there are no matches. * Contains wildcard expressions and there are only partial matches. If true, the API returns an empty datafeeds array when there are no matches and the subset of results when there are partial matches. If false, the API returns a 404 status code when there are no matches or only partial matches.

  • format – Specifies the format to return the columnar data in, can be set to text, json, cbor, yaml, or smile.

  • h – Comma-separated list of column names to display.

  • help – When set to true will output available columns. This option can’t be combined with any other query string option.

  • local – If true, the request computes the list of selected nodes from the local cluster state. If false the list of selected nodes are computed from the cluster state of the master node. In both cases the coordinating node will send requests for further information to each selected node.

  • master_timeout – Period to wait for a connection to the master node.

  • s – Comma-separated list of column names or column aliases used to sort the response.

  • time – The unit used to display time values.

  • v – When set to true will enable verbose output.

ml_jobs(*, job_id: str | None = None, allow_no_match: bool | None = None, bytes: Literal['b', 'gb', 'kb', 'mb', 'pb', 'tb'] | str | None = None, error_trace: bool | None = None, filter_path: str | Sequence[str] | None = None, format: str | None = None, h: Sequence[Literal['assignment_explanation', 'buckets.count', 'buckets.time.exp_avg', 'buckets.time.exp_avg_hour', 'buckets.time.max', 'buckets.time.min', 'buckets.time.total', 'data.buckets', 'data.earliest_record', 'data.empty_buckets', 'data.input_bytes', 'data.input_fields', 'data.input_records', 'data.invalid_dates', 'data.last', 'data.last_empty_bucket', 'data.last_sparse_bucket', 'data.latest_record', 'data.missing_fields', 'data.out_of_order_timestamps', 'data.processed_fields', 'data.processed_records', 'data.sparse_buckets', 'forecasts.memory.avg', 'forecasts.memory.max', 'forecasts.memory.min', 'forecasts.memory.total', 'forecasts.records.avg', 'forecasts.records.max', 'forecasts.records.min', 'forecasts.records.total', 'forecasts.time.avg', 'forecasts.time.max', 'forecasts.time.min', 'forecasts.time.total', 'forecasts.total', 'id', 'model.bucket_allocation_failures', 'model.by_fields', 'model.bytes', 'model.bytes_exceeded', 'model.categorization_status', 'model.categorized_doc_count', 'model.dead_category_count', 'model.failed_category_count', 'model.frequent_category_count', 'model.log_time', 'model.memory_limit', 'model.memory_status', 'model.over_fields', 'model.partition_fields', 'model.rare_category_count', 'model.timestamp', 'model.total_category_count', 'node.address', 'node.ephemeral_id', 'node.id', 'node.name', 'opened_time', 'state'] | str] | Literal['assignment_explanation', 'buckets.count', 'buckets.time.exp_avg', 'buckets.time.exp_avg_hour', 'buckets.time.max', 'buckets.time.min', 'buckets.time.total', 'data.buckets', 'data.earliest_record', 'data.empty_buckets', 'data.input_bytes', 'data.input_fields', 'data.input_records', 'data.invalid_dates', 'data.last', 'data.last_empty_bucket', 'data.last_sparse_bucket', 'data.latest_record', 'data.missing_fields', 'data.out_of_order_timestamps', 'data.processed_fields', 'data.processed_records', 'data.sparse_buckets', 'forecasts.memory.avg', 'forecasts.memory.max', 'forecasts.memory.min', 'forecasts.memory.total', 'forecasts.records.avg', 'forecasts.records.max', 'forecasts.records.min', 'forecasts.records.total', 'forecasts.time.avg', 'forecasts.time.max', 'forecasts.time.min', 'forecasts.time.total', 'forecasts.total', 'id', 'model.bucket_allocation_failures', 'model.by_fields', 'model.bytes', 'model.bytes_exceeded', 'model.categorization_status', 'model.categorized_doc_count', 'model.dead_category_count', 'model.failed_category_count', 'model.frequent_category_count', 'model.log_time', 'model.memory_limit', 'model.memory_status', 'model.over_fields', 'model.partition_fields', 'model.rare_category_count', 'model.timestamp', 'model.total_category_count', 'node.address', 'node.ephemeral_id', 'node.id', 'node.name', 'opened_time', 'state'] | str | None = None, help: bool | None = None, human: bool | None = None, local: bool | None = None, master_timeout: Literal[0] | str | None = None, pretty: bool | None = None, s: Sequence[Literal['assignment_explanation', 'buckets.count', 'buckets.time.exp_avg', 'buckets.time.exp_avg_hour', 'buckets.time.max', 'buckets.time.min', 'buckets.time.total', 'data.buckets', 'data.earliest_record', 'data.empty_buckets', 'data.input_bytes', 'data.input_fields', 'data.input_records', 'data.invalid_dates', 'data.last', 'data.last_empty_bucket', 'data.last_sparse_bucket', 'data.latest_record', 'data.missing_fields', 'data.out_of_order_timestamps', 'data.processed_fields', 'data.processed_records', 'data.sparse_buckets', 'forecasts.memory.avg', 'forecasts.memory.max', 'forecasts.memory.min', 'forecasts.memory.total', 'forecasts.records.avg', 'forecasts.records.max', 'forecasts.records.min', 'forecasts.records.total', 'forecasts.time.avg', 'forecasts.time.max', 'forecasts.time.min', 'forecasts.time.total', 'forecasts.total', 'id', 'model.bucket_allocation_failures', 'model.by_fields', 'model.bytes', 'model.bytes_exceeded', 'model.categorization_status', 'model.categorized_doc_count', 'model.dead_category_count', 'model.failed_category_count', 'model.frequent_category_count', 'model.log_time', 'model.memory_limit', 'model.memory_status', 'model.over_fields', 'model.partition_fields', 'model.rare_category_count', 'model.timestamp', 'model.total_category_count', 'node.address', 'node.ephemeral_id', 'node.id', 'node.name', 'opened_time', 'state'] | str] | Literal['assignment_explanation', 'buckets.count', 'buckets.time.exp_avg', 'buckets.time.exp_avg_hour', 'buckets.time.max', 'buckets.time.min', 'buckets.time.total', 'data.buckets', 'data.earliest_record', 'data.empty_buckets', 'data.input_bytes', 'data.input_fields', 'data.input_records', 'data.invalid_dates', 'data.last', 'data.last_empty_bucket', 'data.last_sparse_bucket', 'data.latest_record', 'data.missing_fields', 'data.out_of_order_timestamps', 'data.processed_fields', 'data.processed_records', 'data.sparse_buckets', 'forecasts.memory.avg', 'forecasts.memory.max', 'forecasts.memory.min', 'forecasts.memory.total', 'forecasts.records.avg', 'forecasts.records.max', 'forecasts.records.min', 'forecasts.records.total', 'forecasts.time.avg', 'forecasts.time.max', 'forecasts.time.min', 'forecasts.time.total', 'forecasts.total', 'id', 'model.bucket_allocation_failures', 'model.by_fields', 'model.bytes', 'model.bytes_exceeded', 'model.categorization_status', 'model.categorized_doc_count', 'model.dead_category_count', 'model.failed_category_count', 'model.frequent_category_count', 'model.log_time', 'model.memory_limit', 'model.memory_status', 'model.over_fields', 'model.partition_fields', 'model.rare_category_count', 'model.timestamp', 'model.total_category_count', 'node.address', 'node.ephemeral_id', 'node.id', 'node.name', 'opened_time', 'state'] | str | None = None, time: Literal['d', 'h', 'm', 'micros', 'ms', 'nanos', 's'] | str | None = None, v: bool | None = None) ObjectApiResponse[Any] | TextApiResponse

Gets configuration and usage information about anomaly detection jobs.

https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-anomaly-detectors.html

Parameters:
  • job_id – Identifier for the anomaly detection job.

  • allow_no_match – Specifies what to do when the request: * Contains wildcard expressions and there are no jobs that match. * Contains the _all string or no identifiers and there are no matches. * Contains wildcard expressions and there are only partial matches. If true, the API returns an empty jobs array when there are no matches and the subset of results when there are partial matches. If false, the API returns a 404 status code when there are no matches or only partial matches.

  • bytes – The unit used to display byte values.

  • format – Specifies the format to return the columnar data in, can be set to text, json, cbor, yaml, or smile.

  • h – Comma-separated list of column names to display.

  • help – When set to true will output available columns. This option can’t be combined with any other query string option.

  • local – If true, the request computes the list of selected nodes from the local cluster state. If false the list of selected nodes are computed from the cluster state of the master node. In both cases the coordinating node will send requests for further information to each selected node.

  • master_timeout – Period to wait for a connection to the master node.

  • s – Comma-separated list of column names or column aliases used to sort the response.

  • time – The unit used to display time values.

  • v – When set to true will enable verbose output.

ml_trained_models(*, model_id: str | None = None, allow_no_match: bool | None = None, bytes: Literal['b', 'gb', 'kb', 'mb', 'pb', 'tb'] | str | None = None, error_trace: bool | None = None, filter_path: str | Sequence[str] | None = None, format: str | None = None, from_: int | None = None, h: Sequence[Literal['create_time', 'created_by', 'data_frame_analytics_id', 'description', 'heap_size', 'id', 'ingest.count', 'ingest.current', 'ingest.failed', 'ingest.pipelines', 'ingest.time', 'license', 'operations', 'version'] | str] | Literal['create_time', 'created_by', 'data_frame_analytics_id', 'description', 'heap_size', 'id', 'ingest.count', 'ingest.current', 'ingest.failed', 'ingest.pipelines', 'ingest.time', 'license', 'operations', 'version'] | str | None = None, help: bool | None = None, human: bool | None = None, local: bool | None = None, master_timeout: Literal[0] | str | None = None, pretty: bool | None = None, s: Sequence[Literal['create_time', 'created_by', 'data_frame_analytics_id', 'description', 'heap_size', 'id', 'ingest.count', 'ingest.current', 'ingest.failed', 'ingest.pipelines', 'ingest.time', 'license', 'operations', 'version'] | str] | Literal['create_time', 'created_by', 'data_frame_analytics_id', 'description', 'heap_size', 'id', 'ingest.count', 'ingest.current', 'ingest.failed', 'ingest.pipelines', 'ingest.time', 'license', 'operations', 'version'] | str | None = None, size: int | None = None, v: bool | None = None) ObjectApiResponse[Any] | TextApiResponse

Gets configuration and usage information about inference trained models.

https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-trained-model.html

Parameters:
  • model_id – A unique identifier for the trained model.

  • allow_no_match – Specifies what to do when the request: contains wildcard expressions and there are no models that match; contains the _all string or no identifiers and there are no matches; contains wildcard expressions and there are only partial matches. If true, the API returns an empty array when there are no matches and the subset of results when there are partial matches. If false, the API returns a 404 status code when there are no matches or only partial matches.

  • bytes – The unit used to display byte values.

  • format – Specifies the format to return the columnar data in, can be set to text, json, cbor, yaml, or smile.

  • from – Skips the specified number of transforms.

  • h – A comma-separated list of column names to display.

  • help – When set to true will output available columns. This option can’t be combined with any other query string option.

  • local – If true, the request computes the list of selected nodes from the local cluster state. If false the list of selected nodes are computed from the cluster state of the master node. In both cases the coordinating node will send requests for further information to each selected node.

  • master_timeout – Period to wait for a connection to the master node.

  • s – A comma-separated list of column names or aliases used to sort the response.

  • size – The maximum number of transforms to display.

  • v – When set to true will enable verbose output.

transforms(*, transform_id: str | None = None, allow_no_match: bool | None = None, error_trace: bool | None = None, filter_path: str | Sequence[str] | None = None, format: str | None = None, from_: int | None = None, h: Sequence[Literal['changes_last_detection_time', 'checkpoint', 'checkpoint_duration_time_exp_avg', 'checkpoint_progress', 'create_time', 'delete_time', 'description', 'dest_index', 'docs_per_second', 'documents_deleted', 'documents_indexed', 'documents_processed', 'frequency', 'id', 'index_failure', 'index_time', 'index_total', 'indexed_documents_exp_avg', 'last_search_time', 'max_page_search_size', 'pages_processed', 'pipeline', 'processed_documents_exp_avg', 'processing_time', 'reason', 'search_failure', 'search_time', 'search_total', 'source_index', 'state', 'transform_type', 'trigger_count', 'version'] | str] | Literal['changes_last_detection_time', 'checkpoint', 'checkpoint_duration_time_exp_avg', 'checkpoint_progress', 'create_time', 'delete_time', 'description', 'dest_index', 'docs_per_second', 'documents_deleted', 'documents_indexed', 'documents_processed', 'frequency', 'id', 'index_failure', 'index_time', 'index_total', 'indexed_documents_exp_avg', 'last_search_time', 'max_page_search_size', 'pages_processed', 'pipeline', 'processed_documents_exp_avg', 'processing_time', 'reason', 'search_failure', 'search_time', 'search_total', 'source_index', 'state', 'transform_type', 'trigger_count', 'version'] | str | None = None, help: bool | None = None, human: bool | None = None, local: bool | None = None, master_timeout: Literal[0] | str | None = None, pretty: bool | None = None, s: Sequence[Literal['changes_last_detection_time', 'checkpoint', 'checkpoint_duration_time_exp_avg', 'checkpoint_progress', 'create_time', 'delete_time', 'description', 'dest_index', 'docs_per_second', 'documents_deleted', 'documents_indexed', 'documents_processed', 'frequency', 'id', 'index_failure', 'index_time', 'index_total', 'indexed_documents_exp_avg', 'last_search_time', 'max_page_search_size', 'pages_processed', 'pipeline', 'processed_documents_exp_avg', 'processing_time', 'reason', 'search_failure', 'search_time', 'search_total', 'source_index', 'state', 'transform_type', 'trigger_count', 'version'] | str] | Literal['changes_last_detection_time', 'checkpoint', 'checkpoint_duration_time_exp_avg', 'checkpoint_progress', 'create_time', 'delete_time', 'description', 'dest_index', 'docs_per_second', 'documents_deleted', 'documents_indexed', 'documents_processed', 'frequency', 'id', 'index_failure', 'index_time', 'index_total', 'indexed_documents_exp_avg', 'last_search_time', 'max_page_search_size', 'pages_processed', 'pipeline', 'processed_documents_exp_avg', 'processing_time', 'reason', 'search_failure', 'search_time', 'search_total', 'source_index', 'state', 'transform_type', 'trigger_count', 'version'] | str | None = None, size: int | None = None, time: Literal['d', 'h', 'm', 'micros', 'ms', 'nanos', 's'] | str | None = None, v: bool | None = None) ObjectApiResponse[Any] | TextApiResponse

Gets configuration and usage information about transforms.

https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-transforms.html

Parameters:
  • transform_id – A transform identifier or a wildcard expression. If you do not specify one of these options, the API returns information for all transforms.

  • allow_no_match – Specifies what to do when the request: contains wildcard expressions and there are no transforms that match; contains the _all string or no identifiers and there are no matches; contains wildcard expressions and there are only partial matches. If true, it returns an empty transforms array when there are no matches and the subset of results when there are partial matches. If false, the request returns a 404 status code when there are no matches or only partial matches.

  • format – Specifies the format to return the columnar data in, can be set to text, json, cbor, yaml, or smile.

  • from – Skips the specified number of transforms.

  • h – Comma-separated list of column names to display.

  • help – When set to true will output available columns. This option can’t be combined with any other query string option.

  • local – If true, the request computes the list of selected nodes from the local cluster state. If false the list of selected nodes are computed from the cluster state of the master node. In both cases the coordinating node will send requests for further information to each selected node.

  • master_timeout – Period to wait for a connection to the master node.

  • s – Comma-separated list of column names or column aliases used to sort the response.

  • size – The maximum number of transforms to obtain.

  • time – The unit used to display time values.

  • v – When set to true will enable verbose output.

Cluster

class elasticsearch_serverless.client.ClusterClient(client: BaseClient)
delete_component_template(*, name: str | Sequence[str], error_trace: bool | None = None, filter_path: str | Sequence[str] | None = None, human: bool | None = None, master_timeout: Literal[0] | str | None = None, pretty: bool | None = None, timeout: Literal[0] | str | None = None) ObjectApiResponse[Any]

Deletes a component template

https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-component-template.html

Parameters:
  • name – Comma-separated list or wildcard expression of component template names used to limit the request.

  • master_timeout – 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 – Period to wait for a response. If no response is received before the timeout expires, the request fails and returns an error.

exists_component_template(*, name: str | Sequence[str], error_trace: bool | None = None, filter_path: str | Sequence[str] | None = None, human: bool | None = None, local: bool | None = None, master_timeout: Literal[0] | str | None = None, pretty: bool | None = None) HeadApiResponse

Returns information about whether a particular component template exist

https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-component-template.html

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

  • local – 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 – 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.

get_component_template(*, name: str | None = None, error_trace: bool | None = None, filter_path: str | Sequence[str] | None = None, flat_settings: bool | None = None, human: bool | None = None, include_defaults: bool | None = None, local: bool | None = None, master_timeout: Literal[0] | str | None = None, pretty: bool | None = None) ObjectApiResponse[Any]

Returns one or more component templates

https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-component-template.html

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

  • flat_settings – If true, returns settings in flat format.

  • include_defaults – Return all default configurations for the component template (default: false)

  • local – If true, the request retrieves information from the local node only. If false, information is retrieved from the master node.

  • master_timeout – 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.

info(*, target: Sequence[Literal['_all', 'http', 'ingest', 'script', 'thread_pool'] | str] | Literal['_all', 'http', 'ingest', 'script', 'thread_pool'] | str, error_trace: bool | None = None, filter_path: str | Sequence[str] | None = None, human: bool | None = None, pretty: bool | None = None) ObjectApiResponse[Any]

Returns different information about the cluster.

https://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-info.html

Parameters:

target – Limits the information returned to the specific target. Supports a comma-separated list, such as http,ingest.

put_component_template(*, name: str, template: Mapping[str, Any] | None = None, allow_auto_create: bool | None = None, create: bool | None = None, error_trace: bool | None = None, filter_path: str | Sequence[str] | None = None, human: bool | None = None, master_timeout: Literal[0] | str | None = None, meta: Mapping[str, Any] | None = None, pretty: bool | None = None, version: int | None = None, body: Dict[str, Any] | None = None) ObjectApiResponse[Any]

Creates or updates a component template

https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-component-template.html

Parameters:
  • name – Name of the component template to create. Elasticsearch includes the following built-in component templates: logs-mappings; ‘logs-settings`; metrics-mappings; metrics-settings;`synthetics-mapping`; synthetics-settings. Elastic Agent uses these templates to configure backing indices for its data streams. If you use Elastic Agent and want to overwrite one of these templates, set the version for your replacement template higher than the current version. If you don’t use Elastic Agent and want to disable all built-in component and index templates, set stack.templates.enabled to false using the cluster update settings API.

  • template – The template to be applied which includes mappings, settings, or aliases configuration.

  • allow_auto_create – 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 data streams matching the template must always be explicitly created.

  • create – If true, this request cannot replace or update existing component templates.

  • master_timeout – 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 – Optional user metadata about the component template. May have any contents. This map is not automatically generated by Elasticsearch. This information is stored in the cluster state, so keeping it short is preferable. To unset _meta, replace the template without specifying this information.

  • version – Version number used to manage component templates externally. This number isn’t automatically generated or incremented by Elasticsearch. To unset a version, replace the template without specifying a version.

Enrich Policies

class elasticsearch_serverless.client.EnrichClient(client: BaseClient)
delete_policy(*, name: str, error_trace: bool | None = None, filter_path: str | Sequence[str] | None = None, human: bool | None = None, pretty: bool | None = None) ObjectApiResponse[Any]

Deletes an existing enrich policy and its enrich index.

https://www.elastic.co/guide/en/elasticsearch/reference/master/delete-enrich-policy-api.html

Parameters:

name – Enrich policy to delete.

execute_policy(*, name: str, error_trace: bool | None = None, filter_path: str | Sequence[str] | None = None, human: bool | None = None, pretty: bool | None = None, wait_for_completion: bool | None = None) ObjectApiResponse[Any]

Creates the enrich index for an existing enrich policy.

https://www.elastic.co/guide/en/elasticsearch/reference/master/execute-enrich-policy-api.html

Parameters:
  • name – Enrich policy to execute.

  • wait_for_completion – If true, the request blocks other enrich policy execution requests until complete.

get_policy(*, name: str | Sequence[str] | None = None, error_trace: bool | None = None, filter_path: str | Sequence[str] | None = None, human: bool | None = None, pretty: bool | None = None) ObjectApiResponse[Any]

Gets information about an enrich policy.

https://www.elastic.co/guide/en/elasticsearch/reference/master/get-enrich-policy-api.html

Parameters:

name – Comma-separated list of enrich policy names used to limit the request. To return information for all enrich policies, omit this parameter.

put_policy(*, name: str, error_trace: bool | None = None, filter_path: str | Sequence[str] | None = None, geo_match: Mapping[str, Any] | None = None, human: bool | None = None, match: Mapping[str, Any] | None = None, pretty: bool | None = None, range: Mapping[str, Any] | None = None, body: Dict[str, Any] | None = None) ObjectApiResponse[Any]

Creates a new enrich policy.

https://www.elastic.co/guide/en/elasticsearch/reference/master/put-enrich-policy-api.html

Parameters:
  • name – Name of the enrich policy to create or update.

  • geo_match – Matches enrich data to incoming documents based on a geo_shape query.

  • match – Matches enrich data to incoming documents based on a term query.

  • range – Matches a number, date, or IP address in incoming documents to a range in the enrich index based on a term query.

stats(*, error_trace: bool | None = None, filter_path: str | Sequence[str] | None = None, human: bool | None = None, pretty: bool | None = None) ObjectApiResponse[Any]

Gets enrich coordinator statistics and information about enrich policies that are currently executing.

https://www.elastic.co/guide/en/elasticsearch/reference/master/enrich-stats-api.html

Event Query Language (EQL)

class elasticsearch_serverless.client.EqlClient(client: BaseClient)
delete(*, id: str, error_trace: bool | None = None, filter_path: str | Sequence[str] | None = None, human: bool | None = None, pretty: bool | None = None) ObjectApiResponse[Any]

Deletes an async EQL search by ID. If the search is still running, the search request will be cancelled. Otherwise, the saved search results are deleted.

https://www.elastic.co/guide/en/elasticsearch/reference/master/eql-search-api.html

Parameters:

id – Identifier for the search to delete. A search ID is provided in the EQL search API’s response for an async search. A search ID is also provided if the request’s keep_on_completion parameter is true.

get(*, id: str, error_trace: bool | None = None, filter_path: str | Sequence[str] | None = None, human: bool | None = None, keep_alive: Literal[0] | str | None = None, pretty: bool | None = None, wait_for_completion_timeout: Literal[0] | str | None = None) ObjectApiResponse[Any]

Returns async results from previously executed Event Query Language (EQL) search

https://www.elastic.co/guide/en/elasticsearch/reference/master/get-async-eql-search-api.html

Parameters:
  • id – Identifier for the search.

  • keep_alive – Period for which the search and its results are stored on the cluster. Defaults to the keep_alive value set by the search’s EQL search API request.

  • wait_for_completion_timeout – Timeout duration to wait for the request to finish. Defaults to no timeout, meaning the request waits for complete search results.

get_status(*, id: str, error_trace: bool | None = None, filter_path: str | Sequence[str] | None = None, human: bool | None = None, pretty: bool | None = None) ObjectApiResponse[Any]

Returns the status of a previously submitted async or stored Event Query Language (EQL) search

https://www.elastic.co/guide/en/elasticsearch/reference/master/get-async-eql-status-api.html

Parameters:

id – Identifier for the search.

search(*, index: str | Sequence[str], query: str | None = None, allow_no_indices: bool | None = None, case_sensitive: bool | None = None, error_trace: bool | None = None, event_category_field: str | None = None, expand_wildcards: Sequence[Literal['all', 'closed', 'hidden', 'none', 'open'] | str] | Literal['all', 'closed', 'hidden', 'none', 'open'] | str | None = None, fetch_size: int | None = None, fields: Mapping[str, Any] | Sequence[Mapping[str, Any]] | None = None, filter: Mapping[str, Any] | Sequence[Mapping[str, Any]] | None = None, filter_path: str | Sequence[str] | None = None, human: bool | None = None, ignore_unavailable: bool | None = None, keep_alive: Literal[0] | str | None = None, keep_on_completion: bool | None = None, pretty: bool | None = None, result_position: Literal['head', 'tail'] | str | None = None, runtime_mappings: Mapping[str, Mapping[str, Any]] | None = None, size: int | None = None, tiebreaker_field: str | None = None, timestamp_field: str | None = None, wait_for_completion_timeout: Literal[0] | str | None = None, body: Dict[str, Any] | None = None) ObjectApiResponse[Any]

Returns results matching a query expressed in Event Query Language (EQL)

https://www.elastic.co/guide/en/elasticsearch/reference/master/eql-search-api.html

Parameters:
  • index – The name of the index to scope the operation

  • query – EQL query you wish to run.

  • allow_no_indices

  • case_sensitive

  • event_category_field – Field containing the event classification, such as process, file, or network.

  • expand_wildcards

  • fetch_size – Maximum number of events to search at a time for sequence queries.

  • fields – Array of wildcard (*) patterns. The response returns values for field names matching these patterns in the fields property of each hit.

  • filter – Query, written in Query DSL, used to filter the events on which the EQL query runs.

  • ignore_unavailable – If true, missing or closed indices are not included in the response.

  • keep_alive

  • keep_on_completion

  • result_position

  • runtime_mappings

  • size – For basic queries, the maximum number of matching events to return. Defaults to 10

  • tiebreaker_field – Field used to sort hits with the same timestamp in ascending order

  • timestamp_field – Field containing event timestamp. Default “@timestamp”

  • wait_for_completion_timeout

Graph Explore

class elasticsearch_serverless.client.GraphClient(client: BaseClient)
explore(*, index: str | Sequence[str], connections: Mapping[str, Any] | None = None, controls: Mapping[str, Any] | None = None, error_trace: bool | None = None, filter_path: str | Sequence[str] | None = None, human: bool | None = None, pretty: bool | None = None, query: Mapping[str, Any] | None = None, routing: str | None = None, timeout: Literal[0] | str | None = None, vertices: Sequence[Mapping[str, Any]] | None = None, body: Dict[str, Any] | None = None) ObjectApiResponse[Any]

Explore extracted and summarized information about the documents and terms in an index.

https://www.elastic.co/guide/en/elasticsearch/reference/master/graph-explore-api.html

Parameters:
  • index – Name of the index.

  • connections – Specifies or more fields from which you want to extract terms that are associated with the specified vertices.

  • controls – Direct the Graph API how to build the graph.

  • query – A seed query that identifies the documents of interest. Can be any valid Elasticsearch query.

  • routing – Custom value used to route operations to a specific shard.

  • timeout – Specifies the period of time to wait for a response from each shard. If no response is received before the timeout expires, the request fails and returns an error. Defaults to no timeout.

  • vertices – Specifies one or more fields that contain the terms you want to include in the graph as vertices.

Indices

class elasticsearch_serverless.client.IndicesClient(client: BaseClient)
add_block(*, index: str, block: Literal['metadata', 'read', 'read_only', 'write'] | str, allow_no_indices: bool | None = None, error_trace: bool | None = None, expand_wildcards: Sequence[Literal['all', 'closed', 'hidden', 'none', 'open'] | str] | Literal['all', 'closed', 'hidden', 'none', 'open'] | str | None = None, filter_path: str | Sequence[str] | None = None, human: bool | None = None, ignore_unavailable: bool | None = None, master_timeout: Literal[0] | str | None = None, pretty: bool | None = None, timeout: Literal[0] | str | None = None) ObjectApiResponse[Any]

Adds a block to an index.

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

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

  • block – The block to add (one of read, write, read_only or metadata)

  • allow_no_indices – 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 – Whether to expand wildcard expression to concrete indices that are open, closed or both.

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

  • master_timeout – Specify timeout for connection to master

  • timeout – Explicit operation timeout

analyze(*, index: str | None = None, analyzer: str | None = None, attributes: Sequence[str] | None = None, char_filter: Sequence[str | Mapping[str, Any]] | None = None, error_trace: bool | None = None, explain: bool | None = None, field: str | None = None, filter: Sequence[str | Mapping[str, Any]] | None = None, filter_path: str | Sequence[str] | None = None, human: bool | None = None, normalizer: str | None = None, pretty: bool | None = None, text: str | Sequence[str] | None = None, tokenizer: str | Mapping[str, Any] | None = None, body: Dict[str, Any] | None = None) ObjectApiResponse[Any]

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

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

Parameters:
  • index – 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 – 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 – Array of token attributes used to filter the output of the explain parameter.

  • char_filter – Array of character filters used to preprocess characters before the tokenizer.

  • explain – If true, the response includes token attributes and additional details.

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

  • filter – Array of token filters used to apply after the tokenizer.

  • normalizer – Normalizer to use to convert text into a single token.

  • text – Text to analyze. If an array of strings is provided, it is analyzed as a multi-value field.

  • tokenizer – Tokenizer to use to convert text into tokens.

create(*, index: str, aliases: Mapping[str, Mapping[str, Any]] | None = None, error_trace: bool | None = None, filter_path: str | Sequence[str] | None = None, human: bool | None = None, mappings: Mapping[str, Any] | None = None, master_timeout: Literal[0] | str | None = None, pretty: bool | None = None, settings: Mapping[str, Any] | None = None, timeout: Literal[0] | str | None = None, wait_for_active_shards: int | Literal['all', 'index-setting'] | str | None = None, body: Dict[str, Any] | None = None) ObjectApiResponse[Any]

Creates an index with optional settings and mappings.

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

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

  • aliases – Aliases for the index.

  • mappings – Mapping for fields in the index. If specified, this mapping can include: - Field names - Field data types - Mapping parameters

  • master_timeout – 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 – Configuration options for the index.

  • timeout – 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 – 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).

create_data_stream(*, name: str, error_trace: bool | None = None, filter_path: str | Sequence[str] | None = None, human: bool | None = None, pretty: bool | None = None) ObjectApiResponse[Any]

Creates a data stream

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

Parameters:

name – 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.

data_streams_stats(*, name: str | None = None, error_trace: bool | None = None, expand_wildcards: Sequence[Literal['all', 'closed', 'hidden', 'none', 'open'] | str] | Literal['all', 'closed', 'hidden', 'none', 'open'] | str | None = None, filter_path: str | Sequence[str] | None = None, human: bool | None = None, pretty: bool | None = None) ObjectApiResponse[Any]

Provides statistics on operations happening in a data stream.

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

Parameters:
  • name – 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 – Type of data stream that wildcard patterns can match. Supports comma-separated values, such as open,hidden.

delete(*, index: str | Sequence[str], allow_no_indices: bool | None = None, error_trace: bool | None = None, expand_wildcards: Sequence[Literal['all', 'closed', 'hidden', 'none', 'open'] | str] | Literal['all', 'closed', 'hidden', 'none', 'open'] | str | None = None, filter_path: str | Sequence[str] | None = None, human: bool | None = None, ignore_unavailable: bool | None = None, master_timeout: Literal[0] | str | None = None, pretty: bool | None = None, timeout: Literal[0] | str | None = None) ObjectApiResponse[Any]

Deletes an index.

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

Parameters:
  • index – 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 – 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 – 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 – If false, the request returns an error if it targets a missing or closed index.

  • master_timeout – 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 – Period to wait for a response. If no response is received before the timeout expires, the request fails and returns an error.

delete_alias(*, index: str | Sequence[str], name: str | Sequence[str], error_trace: bool | None = None, filter_path: str | Sequence[str] | None = None, human: bool | None = None, master_timeout: Literal[0] | str | None = None, pretty: bool | None = None, timeout: Literal[0] | str | None = None) ObjectApiResponse[Any]

Deletes an alias.

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

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

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

  • master_timeout – 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 – Period to wait for a response. If no response is received before the timeout expires, the request fails and returns an error.

delete_data_lifecycle(*, name: str | Sequence[str], error_trace: bool | None = None, expand_wildcards: Sequence[Literal['all', 'closed', 'hidden', 'none', 'open'] | str] | Literal['all', 'closed', 'hidden', 'none', 'open'] | str | None = None, filter_path: str | Sequence[str] | None = None, human: bool | None = None, master_timeout: Literal[0] | str | None = None, pretty: bool | None = None, timeout: Literal[0] | str | None = None) ObjectApiResponse[Any]

Deletes the data stream lifecycle of the selected data streams.

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

Parameters:
  • name – A comma-separated list of data streams of which the data stream lifecycle will be deleted; use * to get all data streams

  • expand_wildcards – Whether wildcard expressions should get expanded to open or closed indices (default: open)

  • master_timeout – Specify timeout for connection to master

  • timeout – Explicit timestamp for the document

delete_data_stream(*, name: str | Sequence[str], error_trace: bool | None = None, expand_wildcards: Sequence[Literal['all', 'closed', 'hidden', 'none', 'open'] | str] | Literal['all', 'closed', 'hidden', 'none', 'open'] | str | None = None, filter_path: str | Sequence[str] | None = None, human: bool | None = None, pretty: bool | None = None) ObjectApiResponse[Any]

Deletes a data stream.

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

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

  • expand_wildcards – Type of data stream that wildcard patterns can match. Supports comma-separated values,such as open,hidden.

delete_index_template(*, name: str | Sequence[str], error_trace: bool | None = None, filter_path: str | Sequence[str] | None = None, human: bool | None = None, master_timeout: Literal[0] | str | None = None, pretty: bool | None = None, timeout: Literal[0] | str | None = None) ObjectApiResponse[Any]

Deletes an index template.

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

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

  • master_timeout – 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 – Period to wait for a response. If no response is received before the timeout expires, the request fails and returns an error.

exists(*, index: str | Sequence[str], allow_no_indices: bool | None = None, error_trace: bool | None = None, expand_wildcards: Sequence[Literal['all', 'closed', 'hidden', 'none', 'open'] | str] | Literal['all', 'closed', 'hidden', 'none', 'open'] | str | None = None, filter_path: str | Sequence[str] | None = None, flat_settings: bool | None = None, human: bool | None = None, ignore_unavailable: bool | None = None, include_defaults: bool | None = None, local: bool | None = None, pretty: bool | None = None) HeadApiResponse

Returns information about whether a particular index exists.

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

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

  • allow_no_indices – 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 – 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 – If true, returns settings in flat format.

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

  • include_defaults – If true, return all default settings in the response.

  • local – If true, the request retrieves information from the local node only.

exists_alias(*, name: str | Sequence[str], index: str | Sequence[str] | None = None, allow_no_indices: bool | None = None, error_trace: bool | None = None, expand_wildcards: Sequence[Literal['all', 'closed', 'hidden', 'none', 'open'] | str] | Literal['all', 'closed', 'hidden', 'none', 'open'] | str | None = None, filter_path: str | Sequence[str] | None = None, human: bool | None = None, ignore_unavailable: bool | None = None, local: bool | None = None, pretty: bool | None = None) HeadApiResponse

Returns information about whether a particular alias exists.

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

Parameters:
  • name – Comma-separated list of aliases to check. Supports wildcards (*).

  • index – 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 – 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 – 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 – If false, requests that include a missing data stream or index in the target indices or data streams return an error.

  • local – If true, the request retrieves information from the local node only.

exists_index_template(*, name: str, error_trace: bool | None = None, filter_path: str | Sequence[str] | None = None, human: bool | None = None, master_timeout: Literal[0] | str | None = None, pretty: bool | None = None) HeadApiResponse

Returns information about whether a particular index template exists.

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

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

  • master_timeout – 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.

explain_data_lifecycle(*, index: str | Sequence[str], error_trace: bool | None = None, filter_path: str | Sequence[str] | None = None, human: bool | None = None, include_defaults: bool | None = None, master_timeout: Literal[0] | str | None = None, pretty: bool | None = None) ObjectApiResponse[Any]

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/master/data-streams-explain-lifecycle.html

Parameters:
  • index – The name of the index to explain

  • include_defaults – indicates if the API should return the default values the system uses for the index’s lifecycle

  • master_timeout – Specify timeout for connection to master

get(*, index: str | Sequence[str], allow_no_indices: bool | None = None, error_trace: bool | None = None, expand_wildcards: Sequence[Literal['all', 'closed', 'hidden', 'none', 'open'] | str] | Literal['all', 'closed', 'hidden', 'none', 'open'] | str | None = None, features: Sequence[Literal['aliases', 'mappings', 'settings'] | str] | Literal['aliases', 'mappings', 'settings'] | str | None = None, filter_path: str | Sequence[str] | None = None, flat_settings: bool | None = None, human: bool | None = None, ignore_unavailable: bool | None = None, include_defaults: bool | None = None, local: bool | None = None, master_timeout: Literal[0] | str | None = None, pretty: bool | None = None) ObjectApiResponse[Any]

Returns information about one or more indices.

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

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

  • allow_no_indices – 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 – 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 – Return only information on specified index features

  • flat_settings – If true, returns settings in flat format.

  • ignore_unavailable – If false, requests that target a missing index return an error.

  • include_defaults – If true, return all default settings in the response.

  • local – 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 – 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.

get_alias(*, index: str | Sequence[str] | None = None, name: str | Sequence[str] | None = None, allow_no_indices: bool | None = None, error_trace: bool | None = None, expand_wildcards: Sequence[Literal['all', 'closed', 'hidden', 'none', 'open'] | str] | Literal['all', 'closed', 'hidden', 'none', 'open'] | str | None = None, filter_path: str | Sequence[str] | None = None, human: bool | None = None, ignore_unavailable: bool | None = None, local: bool | None = None, pretty: bool | None = None) ObjectApiResponse[Any]

Returns an alias.

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

Parameters:
  • index – 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 – Comma-separated list of aliases to retrieve. Supports wildcards (*). To retrieve all aliases, omit this parameter or use * or _all.

  • allow_no_indices – 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 – 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 – If false, the request returns an error if it targets a missing or closed index.

  • local – If true, the request retrieves information from the local node only.

get_data_lifecycle(*, name: str | Sequence[str], error_trace: bool | None = None, expand_wildcards: Sequence[Literal['all', 'closed', 'hidden', 'none', 'open'] | str] | Literal['all', 'closed', 'hidden', 'none', 'open'] | str | None = None, filter_path: str | Sequence[str] | None = None, human: bool | None = None, include_defaults: bool | None = None, pretty: bool | None = None) ObjectApiResponse[Any]

Returns the data stream lifecycle of the selected data streams.

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

Parameters:
  • name – 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 – 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 – If true, return all default settings in the response.

get_data_stream(*, name: str | Sequence[str] | None = None, error_trace: bool | None = None, expand_wildcards: Sequence[Literal['all', 'closed', 'hidden', 'none', 'open'] | str] | Literal['all', 'closed', 'hidden', 'none', 'open'] | str | None = None, filter_path: str | Sequence[str] | None = None, human: bool | None = None, include_defaults: bool | None = None, pretty: bool | None = None) ObjectApiResponse[Any]

Returns data streams.

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

Parameters:
  • name – 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 – Type of data stream that wildcard patterns can match. Supports comma-separated values, such as open,hidden.

  • include_defaults – If true, returns all relevant default configurations for the index template.

get_index_template(*, name: str | None = None, error_trace: bool | None = None, filter_path: str | Sequence[str] | None = None, flat_settings: bool | None = None, human: bool | None = None, include_defaults: bool | None = None, local: bool | None = None, master_timeout: Literal[0] | str | None = None, pretty: bool | None = None) ObjectApiResponse[Any]

Returns an index template.

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

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

  • flat_settings – If true, returns settings in flat format.

  • include_defaults – If true, returns all relevant default configurations for the index template.

  • local – 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 – 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.

get_mapping(*, index: str | Sequence[str] | None = None, allow_no_indices: bool | None = None, error_trace: bool | None = None, expand_wildcards: Sequence[Literal['all', 'closed', 'hidden', 'none', 'open'] | str] | Literal['all', 'closed', 'hidden', 'none', 'open'] | str | None = None, filter_path: str | Sequence[str] | None = None, human: bool | None = None, ignore_unavailable: bool | None = None, local: bool | None = None, master_timeout: Literal[0] | str | None = None, pretty: bool | None = None) ObjectApiResponse[Any]

Returns mappings for one or more indices.

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

Parameters:
  • index – 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 – 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 – 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 – If false, the request returns an error if it targets a missing or closed index.

  • local – If true, the request retrieves information from the local node only.

  • master_timeout – 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.

get_settings(*, index: str | Sequence[str] | None = None, name: str | Sequence[str] | None = None, allow_no_indices: bool | None = None, error_trace: bool | None = None, expand_wildcards: Sequence[Literal['all', 'closed', 'hidden', 'none', 'open'] | str] | Literal['all', 'closed', 'hidden', 'none', 'open'] | str | None = None, filter_path: str | Sequence[str] | None = None, flat_settings: bool | None = None, human: bool | None = None, ignore_unavailable: bool | None = None, include_defaults: bool | None = None, local: bool | None = None, master_timeout: Literal[0] | str | None = None, pretty: bool | None = None) ObjectApiResponse[Any]

Returns settings for one or more indices.

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

Parameters:
  • index – 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 – Comma-separated list or wildcard expression of settings to retrieve.

  • allow_no_indices – 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 – 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 – If true, returns settings in flat format.

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

  • include_defaults – If true, return all default settings in the response.

  • local – If true, the request retrieves information from the local node only. If false, information is retrieved from the master node.

  • master_timeout – 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.

migrate_to_data_stream(*, name: str, error_trace: bool | None = None, filter_path: str | Sequence[str] | None = None, human: bool | None = None, pretty: bool | None = None) ObjectApiResponse[Any]

Migrates an alias to a data stream

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

Parameters:

name – Name of the index alias to convert to a data stream.

modify_data_stream(*, actions: Sequence[Mapping[str, Any]] | None = None, error_trace: bool | None = None, filter_path: str | Sequence[str] | None = None, human: bool | None = None, pretty: bool | None = None, body: Dict[str, Any] | None = None) ObjectApiResponse[Any]

Modifies a data stream

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

Parameters:

actions – Actions to perform.

put_alias(*, index: str | Sequence[str], name: str, error_trace: bool | None = None, filter: Mapping[str, Any] | None = None, filter_path: str | Sequence[str] | None = None, human: bool | None = None, index_routing: str | None = None, is_write_index: bool | None = None, master_timeout: Literal[0] | str | None = None, pretty: bool | None = None, routing: str | None = None, search_routing: str | None = None, timeout: Literal[0] | str | None = None, body: Dict[str, Any] | None = None) ObjectApiResponse[Any]

Creates or updates an alias.

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

Parameters:
  • index – 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 – Alias to update. If the alias doesn’t exist, the request creates it. Index alias names support date math.

  • filter – Query used to limit documents the alias can access.

  • index_routing – 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 – 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 – 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 – Value used to route indexing and search operations to a specific shard. Data stream aliases don’t support this parameter.

  • search_routing – 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 – Period to wait for a response. If no response is received before the timeout expires, the request fails and returns an error.

put_data_lifecycle(*, name: str | Sequence[str], data_retention: Literal[0] | str | None = None, downsampling: Mapping[str, Any] | None = None, error_trace: bool | None = None, expand_wildcards: Sequence[Literal['all', 'closed', 'hidden', 'none', 'open'] | str] | Literal['all', 'closed', 'hidden', 'none', 'open'] | str | None = None, filter_path: str | Sequence[str] | None = None, human: bool | None = None, master_timeout: Literal[0] | str | None = None, pretty: bool | None = None, timeout: Literal[0] | str | None = None, body: Dict[str, Any] | None = None) ObjectApiResponse[Any]

Updates the data stream lifecycle of the selected data streams.

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

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

  • data_retention – 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 – 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 – 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 – 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 – Period to wait for a response. If no response is received before the timeout expires, the request fails and returns an error.

put_index_template(*, name: str, composed_of: Sequence[str] | None = None, create: bool | None = None, data_stream: Mapping[str, Any] | None = None, error_trace: bool | None = None, filter_path: str | Sequence[str] | None = None, human: bool | None = None, index_patterns: str | Sequence[str] | None = None, meta: Mapping[str, Any] | None = None, pretty: bool | None = None, priority: int | None = None, template: Mapping[str, Any] | None = None, version: int | None = None, body: Dict[str, Any] | None = None) ObjectApiResponse[Any]

Creates or updates an index template.

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

Parameters:
  • name – Index or template name

  • composed_of – 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 – If true, this request cannot replace or update existing index templates.

  • data_stream – 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.

  • index_patterns – Name of the index template to create.

  • meta – Optional user metadata about the index template. May have any contents. This map is not automatically generated by Elasticsearch.

  • priority – 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 – Template to be applied. It may optionally include an aliases, mappings, or settings configuration.

  • version – Version number used to manage index templates externally. This number is not automatically generated by Elasticsearch.

put_mapping(*, index: str | Sequence[str], allow_no_indices: bool | None = None, date_detection: bool | None = None, dynamic: Literal['false', 'runtime', 'strict', 'true'] | str | None = None, dynamic_date_formats: Sequence[str] | None = None, dynamic_templates: Mapping[str, Mapping[str, Any]] | Sequence[Mapping[str, Mapping[str, Any]]] | None = None, error_trace: bool | None = None, expand_wildcards: Sequence[Literal['all', 'closed', 'hidden', 'none', 'open'] | str] | Literal['all', 'closed', 'hidden', 'none', 'open'] | str | None = None, field_names: Mapping[str, Any] | None = None, filter_path: str | Sequence[str] | None = None, human: bool | None = None, ignore_unavailable: bool | None = None, master_timeout: Literal[0] | str | None = None, meta: Mapping[str, Any] | None = None, numeric_detection: bool | None = None, pretty: bool | None = None, properties: Mapping[str, Mapping[str, Any]] | None = None, routing: Mapping[str, Any] | None = None, runtime: Mapping[str, Mapping[str, Any]] | None = None, source: Mapping[str, Any] | None = None, timeout: Literal[0] | str | None = None, write_index_only: bool | None = None, body: Dict[str, Any] | None = None) ObjectApiResponse[Any]

Updates the index mappings.

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

Parameters:
  • index – 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 – 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 – Controls whether dynamic date detection is enabled.

  • dynamic – Controls whether new fields are added dynamically.

  • dynamic_date_formats – 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 – Specify dynamic templates for the mapping.

  • expand_wildcards – 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 – Control whether field names are enabled for the index.

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

  • master_timeout – 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 – 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 – Automatically map strings into numeric data types for all fields.

  • properties – Mapping for a field. For new fields, this mapping can include: - Field name - Field data type - Mapping parameters

  • routing – Enable making a routing value required on indexed documents.

  • runtime – Mapping of runtime fields for the index.

  • source – Control whether the _source field is enabled on the index.

  • timeout – 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 – If true, the mappings are applied only to the current write index for the target.

put_settings(*, settings: Mapping[str, Any] | None = None, body: Mapping[str, Any] | None = None, index: str | Sequence[str] | None = None, allow_no_indices: bool | None = None, error_trace: bool | None = None, expand_wildcards: Sequence[Literal['all', 'closed', 'hidden', 'none', 'open'] | str] | Literal['all', 'closed', 'hidden', 'none', 'open'] | str | None = None, filter_path: str | Sequence[str] | None = None, flat_settings: bool | None = None, human: bool | None = None, ignore_unavailable: bool | None = None, master_timeout: Literal[0] | str | None = None, preserve_existing: bool | None = None, pretty: bool | None = None, timeout: Literal[0] | str | None = None) ObjectApiResponse[Any]

Updates the index settings.

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

Parameters:
  • settings

  • index – 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 – 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 – 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 – If true, returns settings in flat format.

  • ignore_unavailable – If true, returns settings in flat format.

  • master_timeout – 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 – If true, existing index settings remain unchanged.

  • timeout – Period to wait for a response. If no response is received before the timeout expires, the request fails and returns an error.

put_template(*, name: str, aliases: Mapping[str, Mapping[str, Any]] | None = None, create: bool | None = None, error_trace: bool | None = None, filter_path: str | Sequence[str] | None = None, flat_settings: bool | None = None, human: bool | None = None, index_patterns: str | Sequence[str] | None = None, mappings: Mapping[str, Any] | None = None, master_timeout: Literal[0] | str | None = None, order: int | None = None, pretty: bool | None = None, settings: Mapping[str, Any] | None = None, timeout: Literal[0] | str | None = None, version: int | None = None, body: Dict[str, Any] | None = None) ObjectApiResponse[Any]

Creates or updates an index template.

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

Parameters:
  • name – The name of the template

  • aliases – Aliases for the index.

  • create – If true, this request cannot replace or update existing index templates.

  • flat_settings – If true, returns settings in flat format.

  • index_patterns – Array of wildcard expressions used to match the names of indices during creation.

  • mappings – Mapping for fields in the index.

  • master_timeout – 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 – 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 – Configuration options for the index.

  • timeout – Period to wait for a response. If no response is received before the timeout expires, the request fails and returns an error.

  • version – Version number used to manage index templates externally. This number is not automatically generated by Elasticsearch.

refresh(*, index: str | Sequence[str] | None = None, allow_no_indices: bool | None = None, error_trace: bool | None = None, expand_wildcards: Sequence[Literal['all', 'closed', 'hidden', 'none', 'open'] | str] | Literal['all', 'closed', 'hidden', 'none', 'open'] | str | None = None, filter_path: str | Sequence[str] | None = None, human: bool | None = None, ignore_unavailable: bool | None = None, pretty: bool | None = None) ObjectApiResponse[Any]

Performs the refresh operation in one or more indices.

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

Parameters:
  • index – 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 – 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 – 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 – If false, the request returns an error if it targets a missing or closed index.

resolve_index(*, name: str | Sequence[str], error_trace: bool | None = None, expand_wildcards: Sequence[Literal['all', 'closed', 'hidden', 'none', 'open'] | str] | Literal['all', 'closed', 'hidden', 'none', 'open'] | str | None = None, filter_path: str | Sequence[str] | None = None, human: bool | None = None, pretty: bool | None = None) ObjectApiResponse[Any]

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

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

Parameters:
  • name – 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 – 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.

rollover(*, alias: str, new_index: str | None = None, aliases: Mapping[str, Mapping[str, Any]] | None = None, conditions: Mapping[str, Any] | None = None, dry_run: bool | None = None, error_trace: bool | None = None, filter_path: str | Sequence[str] | None = None, human: bool | None = None, mappings: Mapping[str, Any] | None = None, master_timeout: Literal[0] | str | None = None, pretty: bool | None = None, settings: Mapping[str, Any] | None = None, timeout: Literal[0] | str | None = None, wait_for_active_shards: int | Literal['all', 'index-setting'] | str | None = None, body: Dict[str, Any] | None = None) ObjectApiResponse[Any]

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/master/indices-rollover-index.html

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

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

  • aliases – Aliases for the target index. Data streams do not support this parameter.

  • conditions – 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 – If true, checks whether the current index satisfies the specified conditions but does not perform a rollover.

  • mappings – Mapping for fields in the index. If specified, this mapping can include field names, field data types, and mapping paramaters.

  • master_timeout – 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 – Configuration options for the index. Data streams do not support this parameter.

  • timeout – 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 – 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).

simulate_index_template(*, name: str, error_trace: bool | None = None, filter_path: str | Sequence[str] | None = None, human: bool | None = None, include_defaults: bool | None = None, master_timeout: Literal[0] | str | None = None, pretty: bool | None = None) ObjectApiResponse[Any]

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

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

Parameters:
  • name – Name of the index to simulate

  • include_defaults – If true, returns all relevant default configurations for the index template.

  • master_timeout – 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.

simulate_template(*, name: str | None = None, allow_auto_create: bool | None = None, composed_of: Sequence[str] | None = None, create: bool | None = None, data_stream: Mapping[str, Any] | None = None, error_trace: bool | None = None, filter_path: str | Sequence[str] | None = None, human: bool | None = None, ignore_missing_component_templates: Sequence[str] | None = None, include_defaults: bool | None = None, index_patterns: str | Sequence[str] | None = None, master_timeout: Literal[0] | str | None = None, meta: Mapping[str, Any] | None = None, pretty: bool | None = None, priority: int | None = None, template: Mapping[str, Any] | None = None, version: int | None = None, body: Dict[str, Any] | None = None) ObjectApiResponse[Any]

Simulate resolving the given template name or body

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

Parameters:
  • name – 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 – 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 – 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 – 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 – 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.

  • ignore_missing_component_templates – The configuration option ignore_missing_component_templates can be used when an index template references a component template that might not exist

  • include_defaults – If true, returns all relevant default configurations for the index template.

  • index_patterns – Array of wildcard (*) expressions used to match the names of data streams and indices during creation.

  • master_timeout – 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 – Optional user metadata about the index template. May have any contents. This map is not automatically generated by Elasticsearch.

  • priority – 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 – Template to be applied. It may optionally include an aliases, mappings, or settings configuration.

  • version – Version number used to manage index templates externally. This number is not automatically generated by Elasticsearch.

update_aliases(*, actions: Sequence[Mapping[str, Any]] | None = None, error_trace: bool | None = None, filter_path: str | Sequence[str] | None = None, human: bool | None = None, master_timeout: Literal[0] | str | None = None, pretty: bool | None = None, timeout: Literal[0] | str | None = None, body: Dict[str, Any] | None = None) ObjectApiResponse[Any]

Updates index aliases.

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

Parameters:
  • actions – Actions to perform.

  • master_timeout – 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 – Period to wait for a response. If no response is received before the timeout expires, the request fails and returns an error.

validate_query(*, index: str | Sequence[str] | None = None, all_shards: bool | None = None, allow_no_indices: bool | None = None, analyze_wildcard: bool | None = None, analyzer: str | None = None, default_operator: Literal['and', 'or'] | str | None = None, df: str | None = None, error_trace: bool | None = None, expand_wildcards: Sequence[Literal['all', 'closed', 'hidden', 'none', 'open'] | str] | Literal['all', 'closed', 'hidden', 'none', 'open'] | str | None = None, explain: bool | None = None, filter_path: str | Sequence[str] | None = None, human: bool | None = None, ignore_unavailable: bool | None = None, lenient: bool | None = None, pretty: bool | None = None, q: str | None = None, query: Mapping[str, Any] | None = None, rewrite: bool | None = None, body: Dict[str, Any] | None = None) ObjectApiResponse[Any]

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

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

Parameters:
  • index – 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 – If true, the validation is executed on all shards instead of one random shard per index.

  • allow_no_indices – 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 – If true, wildcard and prefix queries are analyzed.

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

  • default_operator – The default operator for query string query: AND or OR.

  • df – 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 – 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 – If true, the response returns detailed information if an error has occurred.

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

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

  • q – Query in the Lucene query string syntax.

  • query – Query in the Lucene query string syntax.

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

Inference

class elasticsearch_serverless.client.InferenceClient(client: BaseClient)
delete_model(*, inference_id: str, task_type: Literal['completion', 'rerank', 'sparse_embedding', 'text_embedding'] | str | None = None, error_trace: bool | None = None, filter_path: str | Sequence[str] | None = None, human: bool | None = None, pretty: bool | None = None) ObjectApiResponse[Any]

Delete model in the Inference API

https://www.elastic.co/guide/en/elasticsearch/reference/master/delete-inference-api.html

Parameters:
  • inference_id – The inference Id

  • task_type – The task type

get_model(*, inference_id: str, task_type: Literal['completion', 'rerank', 'sparse_embedding', 'text_embedding'] | str | None = None, error_trace: bool | None = None, filter_path: str | Sequence[str] | None = None, human: bool | None = None, pretty: bool | None = None) ObjectApiResponse[Any]

Get a model in the Inference API

https://www.elastic.co/guide/en/elasticsearch/reference/master/get-inference-api.html

Parameters:
  • inference_id – The inference Id

  • task_type – The task type

inference(*, inference_id: str, input: str | Sequence[str] | None = None, task_type: Literal['completion', 'rerank', 'sparse_embedding', 'text_embedding'] | str | None = None, error_trace: bool | None = None, filter_path: str | Sequence[str] | None = None, human: bool | None = None, pretty: bool | None = None, query: str | None = None, task_settings: Any | None = None, body: Dict[str, Any] | None = None) ObjectApiResponse[Any]

Perform inference on a model

https://www.elastic.co/guide/en/elasticsearch/reference/master/post-inference-api.html

Parameters:
  • inference_id – The inference Id

  • input – Text input to the model. Either a string or an array of strings.

  • task_type – The task type

  • query – Query input, required for rerank task. Not required for other tasks.

  • task_settings – Optional task settings

put_model(*, inference_id: str, model_config: Mapping[str, Any] | None = None, body: Mapping[str, Any] | None = None, task_type: Literal['completion', 'rerank', 'sparse_embedding', 'text_embedding'] | str | None = None, error_trace: bool | None = None, filter_path: str | Sequence[str] | None = None, human: bool | None = None, pretty: bool | None = None) ObjectApiResponse[Any]

Configure a model for use in the Inference API

https://www.elastic.co/guide/en/elasticsearch/reference/master/put-inference-api.html

Parameters:
  • inference_id – The inference Id

  • model_config

  • task_type – The task type

Ingest Pipelines

class elasticsearch_serverless.client.IngestClient(client: BaseClient)
delete_pipeline(*, id: str, error_trace: bool | None = None, filter_path: str | Sequence[str] | None = None, human: bool | None = None, master_timeout: Literal[0] | str | None = None, pretty: bool | None = None, timeout: Literal[0] | str | None = None) ObjectApiResponse[Any]

Deletes a pipeline.

https://www.elastic.co/guide/en/elasticsearch/reference/master/delete-pipeline-api.html

Parameters:
  • id – Pipeline ID or wildcard expression of pipeline IDs used to limit the request. To delete all ingest pipelines in a cluster, use a value of *.

  • master_timeout – 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 – Period to wait for a response. If no response is received before the timeout expires, the request fails and returns an error.

get_pipeline(*, id: str | None = None, error_trace: bool | None = None, filter_path: str | Sequence[str] | None = None, human: bool | None = None, master_timeout: Literal[0] | str | None = None, pretty: bool | None = None, summary: bool | None = None) ObjectApiResponse[Any]

Returns a pipeline.

https://www.elastic.co/guide/en/elasticsearch/reference/master/get-pipeline-api.html

Parameters:
  • id – Comma-separated list of pipeline IDs to retrieve. Wildcard (*) expressions are supported. To get all ingest pipelines, omit this parameter or use *.

  • master_timeout – 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.

  • summary – Return pipelines without their definitions (default: false)

processor_grok(*, error_trace: bool | None = None, filter_path: str | Sequence[str] | None = None, human: bool | None = None, pretty: bool | None = None) ObjectApiResponse[Any]

Returns a list of the built-in patterns.

https://www.elastic.co/guide/en/elasticsearch/reference/master/grok-processor.html

put_pipeline(*, id: str, description: str | None = None, error_trace: bool | None = None, filter_path: str | Sequence[str] | None = None, human: bool | None = None, if_version: int | None = None, master_timeout: Literal[0] | str | None = None, meta: Mapping[str, Any] | None = None, on_failure: Sequence[Mapping[str, Any]] | None = None, pretty: bool | None = None, processors: Sequence[Mapping[str, Any]] | None = None, timeout: Literal[0] | str | None = None, version: int | None = None, body: Dict[str, Any] | None = None) ObjectApiResponse[Any]

Creates or updates a pipeline.

https://www.elastic.co/guide/en/elasticsearch/reference/master/ingest.html

Parameters:
  • id – ID of the ingest pipeline to create or update.

  • description – Description of the ingest pipeline.

  • if_version – Required version for optimistic concurrency control for pipeline updates

  • master_timeout – 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 – Optional metadata about the ingest pipeline. May have any contents. This map is not automatically generated by Elasticsearch.

  • on_failure – Processors to run immediately after a processor failure. Each processor supports a processor-level on_failure value. If a processor without an on_failure value fails, Elasticsearch uses this pipeline-level parameter as a fallback. The processors in this parameter run sequentially in the order specified. Elasticsearch will not attempt to run the pipeline’s remaining processors.

  • processors – Processors used to perform transformations on documents before indexing. Processors run sequentially in the order specified.

  • timeout – Period to wait for a response. If no response is received before the timeout expires, the request fails and returns an error.

  • version – Version number used by external systems to track ingest pipelines. This parameter is intended for external systems only. Elasticsearch does not use or validate pipeline version numbers.

simulate(*, id: str | None = None, docs: Sequence[Mapping[str, Any]] | None = None, error_trace: bool | None = None, filter_path: str | Sequence[str] | None = None, human: bool | None = None, pipeline: Mapping[str, Any] | None = None, pretty: bool | None = None, verbose: bool | None = None, body: Dict[str, Any] | None = None) ObjectApiResponse[Any]

Allows to simulate a pipeline with example documents.

https://www.elastic.co/guide/en/elasticsearch/reference/master/simulate-pipeline-api.html

Parameters:
  • id – Pipeline to test. If you don’t specify a pipeline in the request body, this parameter is required.

  • docs – Sample documents to test in the pipeline.

  • pipeline – Pipeline to test. If you don’t specify the pipeline request path parameter, this parameter is required. If you specify both this and the request path parameter, the API only uses the request path parameter.

  • verbose – If true, the response includes output data for each processor in the executed pipeline.

License

class elasticsearch_serverless.client.LicenseClient(client: BaseClient)
get(*, accept_enterprise: bool | None = None, error_trace: bool | None = None, filter_path: str | Sequence[str] | None = None, human: bool | None = None, local: bool | None = None, pretty: bool | None = None) ObjectApiResponse[Any]

Retrieves licensing information for the cluster

https://www.elastic.co/guide/en/elasticsearch/reference/master/get-license.html

Parameters:
  • accept_enterprise – If true, this parameter returns enterprise for Enterprise license types. If false, this parameter returns platinum for both platinum and enterprise license types. This behavior is maintained for backwards compatibility. This parameter is deprecated and will always be set to true in 8.x.

  • local – Specifies whether to retrieve local information. The default value is false, which means the information is retrieved from the master node.

Logstash

class elasticsearch_serverless.client.LogstashClient(client: BaseClient)
delete_pipeline(*, id: str, error_trace: bool | None = None, filter_path: str | Sequence[str] | None = None, human: bool | None = None, pretty: bool | None = None) ObjectApiResponse[Any]

Deletes Logstash Pipelines used by Central Management

https://www.elastic.co/guide/en/elasticsearch/reference/master/logstash-api-delete-pipeline.html

Parameters:

id – Identifier for the pipeline.

get_pipeline(*, id: str | Sequence[str] | None = None, error_trace: bool | None = None, filter_path: str | Sequence[str] | None = None, human: bool | None = None, pretty: bool | None = None) ObjectApiResponse[Any]

Retrieves Logstash Pipelines used by Central Management

https://www.elastic.co/guide/en/elasticsearch/reference/master/logstash-api-get-pipeline.html

Parameters:

id – Comma-separated list of pipeline identifiers.

put_pipeline(*, id: str, pipeline: Mapping[str, Any] | None = None, body: Mapping[str, Any] | None = None, error_trace: bool | None = None, filter_path: str | Sequence[str] | None = None, human: bool | None = None, pretty: bool | None = None) ObjectApiResponse[Any]

Adds and updates Logstash Pipelines used for Central Management

https://www.elastic.co/guide/en/elasticsearch/reference/master/logstash-api-put-pipeline.html

Parameters:
  • id – Identifier for the pipeline.

  • pipeline

Machine Learning (ML)

class elasticsearch_serverless.client.MlClient(client: BaseClient)
close_job(*, job_id: str, allow_no_match: bool | None = None, error_trace: bool | None = None, filter_path: str | Sequence[str] | None = None, force: bool | None = None, human: bool | None = None, pretty: bool | None = None, timeout: Literal[0] | str | None = None, body: Dict[str, Any] | None = None) ObjectApiResponse[Any]

Closes one or more anomaly detection jobs. A job can be opened and closed multiple times throughout its lifecycle.

https://www.elastic.co/guide/en/elasticsearch/reference/master/ml-close-job.html

Parameters:
  • job_id – Identifier for the anomaly detection job. It can be a job identifier, a group name, or a wildcard expression. You can close multiple anomaly detection jobs in a single API request by using a group name, a comma-separated list of jobs, or a wildcard expression. You can close all jobs by using _all or by specifying * as the job identifier.

  • allow_no_match – Refer to the description for the allow_no_match query parameter.

  • force – Refer to the descriptiion for the force query parameter.

  • timeout – Refer to the description for the timeout query parameter.

delete_calendar(*, calendar_id: str, error_trace: bool | None = None, filter_path: str | Sequence[str] | None = None, human: bool | None = None, pretty: bool | None = None) ObjectApiResponse[Any]

Deletes a calendar.

https://www.elastic.co/guide/en/elasticsearch/reference/master/ml-delete-calendar.html

Parameters:

calendar_id – A string that uniquely identifies a calendar.

delete_calendar_event(*, calendar_id: str, event_id: str, error_trace: bool | None = None, filter_path: str | Sequence[str] | None = None, human: bool | None = None, pretty: bool | None = None) ObjectApiResponse[Any]

Deletes scheduled events from a calendar.

https://www.elastic.co/guide/en/elasticsearch/reference/master/ml-delete-calendar-event.html

Parameters:
  • calendar_id – A string that uniquely identifies a calendar.

  • event_id – Identifier for the scheduled event. You can obtain this identifier by using the get calendar events API.

delete_calendar_job(*, calendar_id: str, job_id: str | Sequence[str], error_trace: bool | None = None, filter_path: str | Sequence[str] | None = None, human: bool | None = None, pretty: bool | None = None) ObjectApiResponse[Any]

Deletes anomaly detection jobs from a calendar.

https://www.elastic.co/guide/en/elasticsearch/reference/master/ml-delete-calendar-job.html

Parameters:
  • calendar_id – A string that uniquely identifies a calendar.

  • job_id – An identifier for the anomaly detection jobs. It can be a job identifier, a group name, or a comma-separated list of jobs or groups.

delete_data_frame_analytics(*, id: str, error_trace: bool | None = None, filter_path: str | Sequence[str] | None = None, force: bool | None = None, human: bool | None = None, pretty: bool | None = None, timeout: Literal[0] | str | None = None) ObjectApiResponse[Any]

Deletes an existing data frame analytics job.

https://www.elastic.co/guide/en/elasticsearch/reference/master/delete-dfanalytics.html

Parameters:
  • id – Identifier for the data frame analytics job.

  • force – If true, it deletes a job that is not stopped; this method is quicker than stopping and deleting the job.

  • timeout – The time to wait for the job to be deleted.

delete_datafeed(*, datafeed_id: str, error_trace: bool | None = None, filter_path: str | Sequence[str] | None = None, force: bool | None = None, human: bool | None = None, pretty: bool | None = None) ObjectApiResponse[Any]

Deletes an existing datafeed.

https://www.elastic.co/guide/en/elasticsearch/reference/master/ml-delete-datafeed.html

Parameters:
  • datafeed_id – A numerical character string that uniquely identifies the datafeed. This identifier can contain lowercase alphanumeric characters (a-z and 0-9), hyphens, and underscores. It must start and end with alphanumeric characters.

  • force – Use to forcefully delete a started datafeed; this method is quicker than stopping and deleting the datafeed.

delete_filter(*, filter_id: str, error_trace: bool | None = None, filter_path: str | Sequence[str] | None = None, human: bool | None = None, pretty: bool | None = None) ObjectApiResponse[Any]

Deletes a filter.

https://www.elastic.co/guide/en/elasticsearch/reference/master/ml-delete-filter.html

Parameters:

filter_id – A string that uniquely identifies a filter.

delete_job(*, job_id: str, delete_user_annotations: bool | None = None, error_trace: bool | None = None, filter_path: str | Sequence[str] | None = None, force: bool | None = None, human: bool | None = None, pretty: bool | None = None, wait_for_completion: bool | None = None) ObjectApiResponse[Any]

Deletes an existing anomaly detection job.

https://www.elastic.co/guide/en/elasticsearch/reference/master/ml-delete-job.html

Parameters:
  • job_id – Identifier for the anomaly detection job.

  • delete_user_annotations – Specifies whether annotations that have been added by the user should be deleted along with any auto-generated annotations when the job is reset.

  • force – Use to forcefully delete an opened job; this method is quicker than closing and deleting the job.

  • wait_for_completion – Specifies whether the request should return immediately or wait until the job deletion completes.

delete_trained_model(*, model_id: str, error_trace: bool | None = None, filter_path: str | Sequence[str] | None = None, force: bool | None = None, human: bool | None = None, pretty: bool | None = None) ObjectApiResponse[Any]

Deletes an existing trained inference model that is currently not referenced by an ingest pipeline.

https://www.elastic.co/guide/en/elasticsearch/reference/master/delete-trained-models.html

Parameters:
  • model_id – The unique identifier of the trained model.

  • force – Forcefully deletes a trained model that is referenced by ingest pipelines or has a started deployment.

delete_trained_model_alias(*, model_id: str, model_alias: str, error_trace: bool | None = None, filter_path: str | Sequence[str] | None = None, human: bool | None = None, pretty: bool | None = None) ObjectApiResponse[Any]

Deletes a model alias that refers to the trained model

https://www.elastic.co/guide/en/elasticsearch/reference/master/delete-trained-models-aliases.html

Parameters:
  • model_id – The trained model ID to which the model alias refers.

  • model_alias – The model alias to delete.

estimate_model_memory(*, analysis_config: Mapping[str, Any] | None = None, error_trace: bool | None = None, filter_path: str | Sequence[str] | None = None, human: bool | None = None, max_bucket_cardinality: Mapping[str, int] | None = None, overall_cardinality: Mapping[str, int] | None = None, pretty: bool | None = None, body: Dict[str, Any] | None = None) ObjectApiResponse[Any]

Estimates the model memory

https://www.elastic.co/guide/en/elasticsearch/reference/master/ml-apis.html

Parameters:
  • analysis_config – For a list of the properties that you can specify in the analysis_config component of the body of this API.

  • max_bucket_cardinality – Estimates of the highest cardinality in a single bucket that is observed for influencer fields over the time period that the job analyzes data. To produce a good answer, values must be provided for all influencer fields. Providing values for fields that are not listed as influencers has no effect on the estimation.

  • overall_cardinality – Estimates of the cardinality that is observed for fields over the whole time period that the job analyzes data. To produce a good answer, values must be provided for fields referenced in the by_field_name, over_field_name and partition_field_name of any detectors. Providing values for other fields has no effect on the estimation. It can be omitted from the request if no detectors have a by_field_name, over_field_name or partition_field_name.

evaluate_data_frame(*, evaluation: Mapping[str, Any] | None = None, index: str | None = None, error_trace: bool | None = None, filter_path: str | Sequence[str] | None = None, human: bool | None = None, pretty: bool | None = None, query: Mapping[str, Any] | None = None, body: Dict[str, Any] | None = None) ObjectApiResponse[Any]

Evaluates the data frame analytics for an annotated index.

https://www.elastic.co/guide/en/elasticsearch/reference/master/evaluate-dfanalytics.html

Parameters:
  • evaluation – Defines the type of evaluation you want to perform.

  • index – Defines the index in which the evaluation will be performed.

  • query – A query clause that retrieves a subset of data from the source index.

flush_job(*, job_id: str, advance_time: str | Any | None = None, calc_interim: bool | None = None, end: str | Any | None = None, error_trace: bool | None = None, filter_path: str | Sequence[str] | None = None, human: bool | None = None, pretty: bool | None = None, skip_time: str | Any | None = None, start: str | Any | None = None, body: Dict[str, Any] | None = None) ObjectApiResponse[Any]

Forces any buffered data to be processed by the job.

https://www.elastic.co/guide/en/elasticsearch/reference/master/ml-flush-job.html

Parameters:
  • job_id – Identifier for the anomaly detection job.

  • advance_time – Refer to the description for the advance_time query parameter.

  • calc_interim – Refer to the description for the calc_interim query parameter.

  • end – Refer to the description for the end query parameter.

  • skip_time – Refer to the description for the skip_time query parameter.

  • start – Refer to the description for the start query parameter.

get_calendar_events(*, calendar_id: str, end: str | Any | None = None, error_trace: bool | None = None, filter_path: str | Sequence[str] | None = None, from_: int | None = None, human: bool | None = None, job_id: str | None = None, pretty: bool | None = None, size: int | None = None, start: str | Any | None = None) ObjectApiResponse[Any]

Retrieves information about the scheduled events in calendars.

https://www.elastic.co/guide/en/elasticsearch/reference/master/ml-get-calendar-event.html

Parameters:
  • calendar_id – A string that uniquely identifies a calendar. You can get information for multiple calendars by using a comma-separated list of ids or a wildcard expression. You can get information for all calendars by using _all or * or by omitting the calendar identifier.

  • end – Specifies to get events with timestamps earlier than this time.

  • from – Skips the specified number of events.

  • job_id – Specifies to get events for a specific anomaly detection job identifier or job group. It must be used with a calendar identifier of _all or *.

  • size – Specifies the maximum number of events to obtain.

  • start – Specifies to get events with timestamps after this time.

get_calendars(*, calendar_id: str | None = None, error_trace: bool | None = None, filter_path: str | Sequence[str] | None = None, from_: int | None = None, human: bool | None = None, page: Mapping[str, Any] | None = None, pretty: bool | None = None, size: int | None = None, body: Dict[str, Any] | None = None) ObjectApiResponse[Any]

Retrieves configuration information for calendars.

https://www.elastic.co/guide/en/elasticsearch/reference/master/ml-get-calendar.html

Parameters:
  • calendar_id – A string that uniquely identifies a calendar. You can get information for multiple calendars by using a comma-separated list of ids or a wildcard expression. You can get information for all calendars by using _all or * or by omitting the calendar identifier.

  • from – Skips the specified number of calendars. This parameter is supported only when you omit the calendar identifier.

  • page – This object is supported only when you omit the calendar identifier.

  • size – Specifies the maximum number of calendars to obtain. This parameter is supported only when you omit the calendar identifier.

get_data_frame_analytics(*, id: str | None = None, allow_no_match: bool | None = None, error_trace: bool | None = None, exclude_generated: bool | None = None, filter_path: str | Sequence[str] | None = None, from_: int | None = None, human: bool | None = None, pretty: bool | None = None, size: int | None = None) ObjectApiResponse[Any]

Retrieves configuration information for data frame analytics jobs.

https://www.elastic.co/guide/en/elasticsearch/reference/master/get-dfanalytics.html

Parameters:
  • id – Identifier for the data frame analytics job. If you do not specify this option, the API returns information for the first hundred data frame analytics jobs.

  • allow_no_match – Specifies what to do when the request: 1. Contains wildcard expressions and there are no data frame analytics jobs that match. 2. Contains the _all string or no identifiers and there are no matches. 3. Contains wildcard expressions and there are only partial matches. The default value returns an empty data_frame_analytics array when there are no matches and the subset of results when there are partial matches. If this parameter is false, the request returns a 404 status code when there are no matches or only partial matches.

  • exclude_generated – Indicates if certain fields should be removed from the configuration on retrieval. This allows the configuration to be in an acceptable format to be retrieved and then added to another cluster.

  • from – Skips the specified number of data frame analytics jobs.

  • size – Specifies the maximum number of data frame analytics jobs to obtain.

get_data_frame_analytics_stats(*, id: str | None = None, allow_no_match: bool | None = None, error_trace: bool | None = None, filter_path: str | Sequence[str] | None = None, from_: int | None = None, human: bool | None = None, pretty: bool | None = None, size: int | None = None, verbose: bool | None = None) ObjectApiResponse[Any]

Retrieves usage information for data frame analytics jobs.

https://www.elastic.co/guide/en/elasticsearch/reference/master/get-dfanalytics-stats.html

Parameters:
  • id – Identifier for the data frame analytics job. If you do not specify this option, the API returns information for the first hundred data frame analytics jobs.

  • allow_no_match – Specifies what to do when the request: 1. Contains wildcard expressions and there are no data frame analytics jobs that match. 2. Contains the _all string or no identifiers and there are no matches. 3. Contains wildcard expressions and there are only partial matches. The default value returns an empty data_frame_analytics array when there are no matches and the subset of results when there are partial matches. If this parameter is false, the request returns a 404 status code when there are no matches or only partial matches.

  • from – Skips the specified number of data frame analytics jobs.

  • size – Specifies the maximum number of data frame analytics jobs to obtain.

  • verbose – Defines whether the stats response should be verbose.

get_datafeed_stats(*, datafeed_id: str | Sequence[str] | None = None, allow_no_match: bool | None = None, error_trace: bool | None = None, filter_path: str | Sequence[str] | None = None, human: bool | None = None, pretty: bool | None = None) ObjectApiResponse[Any]

Retrieves usage information for datafeeds.

https://www.elastic.co/guide/en/elasticsearch/reference/master/ml-get-datafeed-stats.html

Parameters:
  • datafeed_id – Identifier for the datafeed. It can be a datafeed identifier or a wildcard expression. If you do not specify one of these options, the API returns information about all datafeeds.

  • allow_no_match – Specifies what to do when the request: 1. Contains wildcard expressions and there are no datafeeds that match. 2. Contains the _all string or no identifiers and there are no matches. 3. Contains wildcard expressions and there are only partial matches. The default value is true, which returns an empty datafeeds array when there are no matches and the subset of results when there are partial matches. If this parameter is false, the request returns a 404 status code when there are no matches or only partial matches.

get_datafeeds(*, datafeed_id: str | Sequence[str] | None = None, allow_no_match: bool | None = None, error_trace: bool | None = None, exclude_generated: bool | None = None, filter_path: str | Sequence[str] | None = None, human: bool | None = None, pretty: bool | None = None) ObjectApiResponse[Any]

Retrieves configuration information for datafeeds.

https://www.elastic.co/guide/en/elasticsearch/reference/master/ml-get-datafeed.html

Parameters:
  • datafeed_id – Identifier for the datafeed. It can be a datafeed identifier or a wildcard expression. If you do not specify one of these options, the API returns information about all datafeeds.

  • allow_no_match – Specifies what to do when the request: 1. Contains wildcard expressions and there are no datafeeds that match. 2. Contains the _all string or no identifiers and there are no matches. 3. Contains wildcard expressions and there are only partial matches. The default value is true, which returns an empty datafeeds array when there are no matches and the subset of results when there are partial matches. If this parameter is false, the request returns a 404 status code when there are no matches or only partial matches.

  • exclude_generated – Indicates if certain fields should be removed from the configuration on retrieval. This allows the configuration to be in an acceptable format to be retrieved and then added to another cluster.

get_filters(*, filter_id: str | Sequence[str] | None = None, error_trace: bool | None = None, filter_path: str | Sequence[str] | None = None, from_: int | None = None, human: bool | None = None, pretty: bool | None = None, size: int | None = None) ObjectApiResponse[Any]

Retrieves filters.

https://www.elastic.co/guide/en/elasticsearch/reference/master/ml-get-filter.html

Parameters:
  • filter_id – A string that uniquely identifies a filter.

  • from – Skips the specified number of filters.

  • size – Specifies the maximum number of filters to obtain.

get_job_stats(*, job_id: str | None = None, allow_no_match: bool | None = None, error_trace: bool | None = None, filter_path: str | Sequence[str] | None = None, human: bool | None = None, pretty: bool | None = None) ObjectApiResponse[Any]

Retrieves usage information for anomaly detection jobs.

https://www.elastic.co/guide/en/elasticsearch/reference/master/ml-get-job-stats.html

Parameters:
  • job_id – Identifier for the anomaly detection job. It can be a job identifier, a group name, a comma-separated list of jobs, or a wildcard expression. If you do not specify one of these options, the API returns information for all anomaly detection jobs.

  • allow_no_match – Specifies what to do when the request: 1. Contains wildcard expressions and there are no jobs that match. 2. Contains the _all string or no identifiers and there are no matches. 3. Contains wildcard expressions and there are only partial matches. If true, the API returns an empty jobs array when there are no matches and the subset of results when there are partial matches. If false, the API returns a 404 status code when there are no matches or only partial matches.

get_jobs(*, job_id: str | Sequence[str] | None = None, allow_no_match: bool | None = None, error_trace: bool | None = None, exclude_generated: bool | None = None, filter_path: str | Sequence[str] | None = None, human: bool | None = None, pretty: bool | None = None) ObjectApiResponse[Any]

Retrieves configuration information for anomaly detection jobs.

https://www.elastic.co/guide/en/elasticsearch/reference/master/ml-get-job.html

Parameters:
  • job_id – Identifier for the anomaly detection job. It can be a job identifier, a group name, or a wildcard expression. If you do not specify one of these options, the API returns information for all anomaly detection jobs.

  • allow_no_match – Specifies what to do when the request: 1. Contains wildcard expressions and there are no jobs that match. 2. Contains the _all string or no identifiers and there are no matches. 3. Contains wildcard expressions and there are only partial matches. The default value is true, which returns an empty jobs array when there are no matches and the subset of results when there are partial matches. If this parameter is false, the request returns a 404 status code when there are no matches or only partial matches.

  • exclude_generated – Indicates if certain fields should be removed from the configuration on retrieval. This allows the configuration to be in an acceptable format to be retrieved and then added to another cluster.

get_overall_buckets(*, job_id: str, allow_no_match: bool | None = None, bucket_span: Literal[0] | str | None = None, end: str | Any | None = None, error_trace: bool | None = None, exclude_interim: bool | None = None, filter_path: str | Sequence[str] | None = None, human: bool | None = None, overall_score: float | str | None = None, pretty: bool | None = None, start: str | Any | None = None, top_n: int | None = None, body: Dict[str, Any] | None = None) ObjectApiResponse[Any]

Retrieves overall bucket results that summarize the bucket results of multiple anomaly detection jobs.

https://www.elastic.co/guide/en/elasticsearch/reference/master/ml-get-overall-buckets.html

Parameters:
  • job_id – Identifier for the anomaly detection job. It can be a job identifier, a group name, a comma-separated list of jobs or groups, or a wildcard expression. You can summarize the bucket results for all anomaly detection jobs by using _all or by specifying * as the <job_id>.

  • allow_no_match – Refer to the description for the allow_no_match query parameter.

  • bucket_span – Refer to the description for the bucket_span query parameter.

  • end – Refer to the description for the end query parameter.

  • exclude_interim – Refer to the description for the exclude_interim query parameter.

  • overall_score – Refer to the description for the overall_score query parameter.

  • start – Refer to the description for the start query parameter.

  • top_n – Refer to the description for the top_n query parameter.

get_trained_models(*, model_id: str | None = None, allow_no_match: bool | None = None, decompress_definition: bool | None = None, error_trace: bool | None = None, exclude_generated: bool | None = None, filter_path: str | Sequence[str] | None = None, from_: int | None = None, human: bool | None = None, include: Literal['definition', 'definition_status', 'feature_importance_baseline', 'hyperparameters', 'total_feature_importance'] | str | None = None, pretty: bool | None = None, size: int | None = None, tags: str | None = None) ObjectApiResponse[Any]

Retrieves configuration information for a trained inference model.

https://www.elastic.co/guide/en/elasticsearch/reference/master/get-trained-models.html

Parameters:
  • model_id – The unique identifier of the trained model.

  • allow_no_match – Specifies what to do when the request: - Contains wildcard expressions and there are no models that match. - Contains the _all string or no identifiers and there are no matches. - Contains wildcard expressions and there are only partial matches. If true, it returns an empty array when there are no matches and the subset of results when there are partial matches.

  • decompress_definition – Specifies whether the included model definition should be returned as a JSON map (true) or in a custom compressed format (false).

  • exclude_generated – Indicates if certain fields should be removed from the configuration on retrieval. This allows the configuration to be in an acceptable format to be retrieved and then added to another cluster.

  • from – Skips the specified number of models.

  • include – A comma delimited string of optional fields to include in the response body.

  • size – Specifies the maximum number of models to obtain.

  • tags – A comma delimited string of tags. A trained model can have many tags, or none. When supplied, only trained models that contain all the supplied tags are returned.

get_trained_models_stats(*, model_id: str | Sequence[str] | None = None, allow_no_match: bool | None = None, error_trace: bool | None = None, filter_path: str | Sequence[str] | None = None, from_: int | None = None, human: bool | None = None, pretty: bool | None = None, size: int | None = None) ObjectApiResponse[Any]

Retrieves usage information for trained inference models.

https://www.elastic.co/guide/en/elasticsearch/reference/master/get-trained-models-stats.html

Parameters:
  • model_id – The unique identifier of the trained model or a model alias. It can be a comma-separated list or a wildcard expression.

  • allow_no_match – Specifies what to do when the request: - Contains wildcard expressions and there are no models that match. - Contains the _all string or no identifiers and there are no matches. - Contains wildcard expressions and there are only partial matches. If true, it returns an empty array when there are no matches and the subset of results when there are partial matches.

  • from – Skips the specified number of models.

  • size – Specifies the maximum number of models to obtain.

infer_trained_model(*, model_id: str, docs: Sequence[Mapping[str, Any]] | None = None, error_trace: bool | None = None, filter_path: str | Sequence[str] | None = None, human: bool | None = None, inference_config: Mapping[str, Any] | None = None, pretty: bool | None = None, timeout: Literal[0] | str | None = None, body: Dict[str, Any] | None = None) ObjectApiResponse[Any]

Evaluate a trained model.

https://www.elastic.co/guide/en/elasticsearch/reference/master/infer-trained-model.html

Parameters:
  • model_id – The unique identifier of the trained model.

  • docs – An array of objects to pass to the model for inference. The objects should contain a fields matching your configured trained model input. Typically, for NLP models, the field name is text_field. Currently, for NLP models, only a single value is allowed.

  • inference_config – The inference configuration updates to apply on the API call

  • timeout – Controls the amount of time to wait for inference results.

open_job(*, job_id: str, error_trace: bool | None = None, filter_path: str | Sequence[str] | None = None, human: bool | None = None, pretty: bool | None = None, timeout: Literal[0] | str | None = None, body: Dict[str, Any] | None = None) ObjectApiResponse[Any]

Opens one or more anomaly detection jobs.

https://www.elastic.co/guide/en/elasticsearch/reference/master/ml-open-job.html

Parameters:
  • job_id – Identifier for the anomaly detection job.

  • timeout – Refer to the description for the timeout query parameter.

post_calendar_events(*, calendar_id: str, events: Sequence[Mapping[str, Any]] | None = None, error_trace: bool | None = None, filter_path: str | Sequence[str] | None = None, human: bool | None = None, pretty: bool | None = None, body: Dict[str, Any] | None = None) ObjectApiResponse[Any]

Posts scheduled events in a calendar.

https://www.elastic.co/guide/en/elasticsearch/reference/master/ml-post-calendar-event.html

Parameters:
  • calendar_id – A string that uniquely identifies a calendar.

  • events – A list of one of more scheduled events. The event’s start and end times can be specified as integer milliseconds since the epoch or as a string in ISO 8601 format.

preview_data_frame_analytics(*, id: str | None = None, config: Mapping[str, Any] | None = None, error_trace: bool | None = None, filter_path: str | Sequence[str] | None = None, human: bool | None = None, pretty: bool | None = None, body: Dict[str, Any] | None = None) ObjectApiResponse[Any]

Previews that will be analyzed given a data frame analytics config.

https://www.elastic.co/guide/en/elasticsearch/reference/master/preview-dfanalytics.html

Parameters:
  • id – Identifier for the data frame analytics job.

  • config – A data frame analytics config as described in create data frame analytics jobs. Note that id and dest don’t need to be provided in the context of this API.

preview_datafeed(*, datafeed_id: str | None = None, datafeed_config: Mapping[str, Any] | None = None, end: str | Any | None = None, error_trace: bool | None = None, filter_path: str | Sequence[str] | None = None, human: bool | None = None, job_config: Mapping[str, Any] | None = None, pretty: bool | None = None, start: str | Any | None = None, body: Dict[str, Any] | None = None) ObjectApiResponse[Any]

Previews a datafeed.

https://www.elastic.co/guide/en/elasticsearch/reference/master/ml-preview-datafeed.html

Parameters:
  • datafeed_id – A numerical character string that uniquely identifies the datafeed. This identifier can contain lowercase alphanumeric characters (a-z and 0-9), hyphens, and underscores. It must start and end with alphanumeric characters. NOTE: If you use this path parameter, you cannot provide datafeed or anomaly detection job configuration details in the request body.

  • datafeed_config – The datafeed definition to preview.

  • end – The end time when the datafeed preview should stop

  • job_config – The configuration details for the anomaly detection job that is associated with the datafeed. If the datafeed_config object does not include a job_id that references an existing anomaly detection job, you must supply this job_config object. If you include both a job_id and a job_config, the latter information is used. You cannot specify a job_config object unless you also supply a datafeed_config object.

  • start – The start time from where the datafeed preview should begin

put_calendar(*, calendar_id: str, description: str | None = None, error_trace: bool | None = None, filter_path: str | Sequence[str] | None = None, human: bool | None = None, job_ids: Sequence[str] | None = None, pretty: bool | None = None, body: Dict[str, Any] | None = None) ObjectApiResponse[Any]

Instantiates a calendar.

https://www.elastic.co/guide/en/elasticsearch/reference/master/ml-put-calendar.html

Parameters:
  • calendar_id – A string that uniquely identifies a calendar.

  • description – A description of the calendar.

  • job_ids – An array of anomaly detection job identifiers.

put_calendar_job(*, calendar_id: str, job_id: str, error_trace: bool | None = None, filter_path: str | Sequence[str] | None = None, human: bool | None = None, pretty: bool | None = None) ObjectApiResponse[Any]

Adds an anomaly detection job to a calendar.

https://www.elastic.co/guide/en/elasticsearch/reference/master/ml-put-calendar-job.html

Parameters:
  • calendar_id – A string that uniquely identifies a calendar.

  • job_id – An identifier for the anomaly detection jobs. It can be a job identifier, a group name, or a comma-separated list of jobs or groups.

put_data_frame_analytics(*, id: str, analysis: Mapping[str, Any] | None = None, dest: Mapping[str, Any] | None = None, source: Mapping[str, Any] | None = None, allow_lazy_start: bool | None = None, analyzed_fields: Mapping[str, Any] | None = None, description: str | None = None, error_trace: bool | None = None, filter_path: str | Sequence[str] | None = None, headers: Mapping[str, str | Sequence[str]] | None = None, human: bool | None = None, max_num_threads: int | None = None, model_memory_limit: str | None = None, pretty: bool | None = None, version: str | None = None, body: Dict[str, Any] | None = None) ObjectApiResponse[Any]

Instantiates a data frame analytics job.

https://www.elastic.co/guide/en/elasticsearch/reference/master/put-dfanalytics.html

Parameters:
  • id – Identifier for the data frame analytics job. This identifier can contain lowercase alphanumeric characters (a-z and 0-9), hyphens, and underscores. It must start and end with alphanumeric characters.

  • analysis – The analysis configuration, which contains the information necessary to perform one of the following types of analysis: classification, outlier detection, or regression.

  • dest – The destination configuration.

  • source – The configuration of how to source the analysis data.

  • allow_lazy_start – Specifies whether this job can start when there is insufficient machine learning node capacity for it to be immediately assigned to a node. If set to false and a machine learning node with capacity to run the job cannot be immediately found, the API returns an error. If set to true, the API does not return an error; the job waits in the starting state until sufficient machine learning node capacity is available. This behavior is also affected by the cluster-wide xpack.ml.max_lazy_ml_nodes setting.

  • analyzed_fields – Specifies includes and/or excludes patterns to select which fields will be included in the analysis. The patterns specified in excludes are applied last, therefore excludes takes precedence. In other words, if the same field is specified in both includes and excludes, then the field will not be included in the analysis. If analyzed_fields is not set, only the relevant fields will be included. For example, all the numeric fields for outlier detection. The supported fields vary for each type of analysis. Outlier detection requires numeric or boolean data to analyze. The algorithms don’t support missing values therefore fields that have data types other than numeric or boolean are ignored. Documents where included fields contain missing values, null values, or an array are also ignored. Therefore the dest index may contain documents that don’t have an outlier score. Regression supports fields that are numeric, boolean, text, keyword, and ip data types. It is also tolerant of missing values. Fields that are supported are included in the analysis, other fields are ignored. Documents where included fields contain an array with two or more values are also ignored. Documents in the dest index that don’t contain a results field are not included in the regression analysis. Classification supports fields that are numeric, boolean, text, keyword, and ip data types. It is also tolerant of missing values. Fields that are supported are included in the analysis, other fields are ignored. Documents where included fields contain an array with two or more values are also ignored. Documents in the dest index that don’t contain a results field are not included in the classification analysis. Classification analysis can be improved by mapping ordinal variable values to a single number. For example, in case of age ranges, you can model the values as 0-14 = 0, 15-24 = 1, 25-34 = 2, and so on.

  • description – A description of the job.

  • headers

  • max_num_threads – The maximum number of threads to be used by the analysis. Using more threads may decrease the time necessary to complete the analysis at the cost of using more CPU. Note that the process may use additional threads for operational functionality other than the analysis itself.

  • model_memory_limit – The approximate maximum amount of memory resources that are permitted for analytical processing. If your elasticsearch.yml file contains an xpack.ml.max_model_memory_limit setting, an error occurs when you try to create data frame analytics jobs that have model_memory_limit values greater than that setting.

  • version

put_datafeed(*, datafeed_id: str, aggregations: Mapping[str, Mapping[str, Any]] | None = None, allow_no_indices: bool | None = None, chunking_config: Mapping[str, Any] | None = None, delayed_data_check_config: Mapping[str, Any] | None = None, error_trace: bool | None = None, expand_wildcards: Sequence[Literal['all', 'closed', 'hidden', 'none', 'open'] | str] | Literal['all', 'closed', 'hidden', 'none', 'open'] | str | None = None, filter_path: str | Sequence[str] | None = None, frequency: Literal[0] | str | None = None, headers: Mapping[str, str | Sequence[str]] | None = None, human: bool | None = None, ignore_throttled: bool | None = None, ignore_unavailable: bool | None = None, indexes: str | Sequence[str] | None = None, indices: str | Sequence[str] | None = None, indices_options: Mapping[str, Any] | None = None, job_id: str | None = None, max_empty_searches: int | None = None, pretty: bool | None = None, query: Mapping[str, Any] | None = None, query_delay: Literal[0] | str | None = None, runtime_mappings: Mapping[str, Mapping[str, Any]] | None = None, script_fields: Mapping[str, Mapping[str, Any]] | None = None, scroll_size: int | None = None, body: Dict[str, Any] | None = None) ObjectApiResponse[Any]

Instantiates a datafeed.

https://www.elastic.co/guide/en/elasticsearch/reference/master/ml-put-datafeed.html

Parameters:
  • datafeed_id – A numerical character string that uniquely identifies the datafeed. This identifier can contain lowercase alphanumeric characters (a-z and 0-9), hyphens, and underscores. It must start and end with alphanumeric characters.

  • aggregations – If set, the datafeed performs aggregation searches. Support for aggregations is limited and should be used only with low cardinality data.

  • allow_no_indices – If true, wildcard indices expressions that resolve into no concrete indices are ignored. This includes the _all string or when no indices are specified.

  • chunking_config – Datafeeds might be required to search over long time periods, for several months or years. This search is split into time chunks in order to ensure the load on Elasticsearch is managed. Chunking configuration controls how the size of these time chunks are calculated; it is an advanced configuration option.

  • delayed_data_check_config – Specifies whether the datafeed checks for missing data and the size of the window. The datafeed can optionally search over indices that have already been read in an effort to determine whether any data has subsequently been added to the index. If missing data is found, it is a good indication that the query_delay is set too low and the data is being indexed after the datafeed has passed that moment in time. This check runs only on real-time datafeeds.

  • expand_wildcards – 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.

  • frequency – The interval at which scheduled queries are made while the datafeed runs in real time. The default value is either the bucket span for short bucket spans, or, for longer bucket spans, a sensible fraction of the bucket span. When frequency is shorter than the bucket span, interim results for the last (partial) bucket are written then eventually overwritten by the full bucket results. If the datafeed uses aggregations, this value must be divisible by the interval of the date histogram aggregation.

  • headers

  • ignore_throttled – If true, concrete, expanded, or aliased indices are ignored when frozen.

  • ignore_unavailable – If true, unavailable indices (missing or closed) are ignored.

  • indexes – An array of index names. Wildcards are supported. If any of the indices are in remote clusters, the machine learning nodes must have the remote_cluster_client role.

  • indices – An array of index names. Wildcards are supported. If any of the indices are in remote clusters, the machine learning nodes must have the remote_cluster_client role.

  • indices_options – Specifies index expansion options that are used during search

  • job_id – Identifier for the anomaly detection job.

  • max_empty_searches – If a real-time datafeed has never seen any data (including during any initial training period), it automatically stops and closes the associated job after this many real-time searches return no documents. In other words, it stops after frequency times max_empty_searches of real-time operation. If not set, a datafeed with no end time that sees no data remains started until it is explicitly stopped. By default, it is not set.

  • query – The Elasticsearch query domain-specific language (DSL). This value corresponds to the query object in an Elasticsearch search POST body. All the options that are supported by Elasticsearch can be used, as this object is passed verbatim to Elasticsearch.

  • query_delay – The number of seconds behind real time that data is queried. For example, if data from 10:04 a.m. might not be searchable in Elasticsearch until 10:06 a.m., set this property to 120 seconds. The default value is randomly selected between 60s and 120s. This randomness improves the query performance when there are multiple jobs running on the same node.

  • runtime_mappings – Specifies runtime fields for the datafeed search.

  • script_fields – Specifies scripts that evaluate custom expressions and returns script fields to the datafeed. The detector configuration objects in a job can contain functions that use these script fields.

  • scroll_size – The size parameter that is used in Elasticsearch searches when the datafeed does not use aggregations. The maximum value is the value of index.max_result_window, which is 10,000 by default.

put_filter(*, filter_id: str, description: str | None = None, error_trace: bool | None = None, filter_path: str | Sequence[str] | None = None, human: bool | None = None, items: Sequence[str] | None = None, pretty: bool | None = None, body: Dict[str, Any] | None = None) ObjectApiResponse[Any]

Instantiates a filter.

https://www.elastic.co/guide/en/elasticsearch/reference/master/ml-put-filter.html

Parameters:
  • filter_id – A string that uniquely identifies a filter.

  • description – A description of the filter.

  • items – The items of the filter. A wildcard * can be used at the beginning or the end of an item. Up to 10000 items are allowed in each filter.

put_job(*, job_id: str, analysis_config: Mapping[str, Any] | None = None, data_description: Mapping[str, Any] | None = None, allow_lazy_open: bool | None = None, analysis_limits: Mapping[str, Any] | None = None, background_persist_interval: Literal[0] | str | None = None, custom_settings: Any | None = None, daily_model_snapshot_retention_after_days: int | None = None, datafeed_config: Mapping[str, Any] | None = None, description: str | None = None, error_trace: bool | None = None, filter_path: str | Sequence[str] | None = None, groups: Sequence[str] | None = None, human: bool | None = None, model_plot_config: Mapping[str, Any] | None = None, model_snapshot_retention_days: int | None = None, pretty: bool | None = None, renormalization_window_days: int | None = None, results_index_name: str | None = None, results_retention_days: int | None = None, body: Dict[str, Any] | None = None) ObjectApiResponse[Any]

Instantiates an anomaly detection job.

https://www.elastic.co/guide/en/elasticsearch/reference/master/ml-put-job.html

Parameters:
  • job_id – The identifier for the anomaly detection job. This identifier can contain lowercase alphanumeric characters (a-z and 0-9), hyphens, and underscores. It must start and end with alphanumeric characters.

  • analysis_config – Specifies how to analyze the data. After you create a job, you cannot change the analysis configuration; all the properties are informational.

  • data_description – Defines the format of the input data when you send data to the job by using the post data API. Note that when configure a datafeed, these properties are automatically set. When data is received via the post data API, it is not stored in Elasticsearch. Only the results for anomaly detection are retained.

  • allow_lazy_open – Advanced configuration option. Specifies whether this job can open when there is insufficient machine learning node capacity for it to be immediately assigned to a node. By default, if a machine learning node with capacity to run the job cannot immediately be found, the open anomaly detection jobs API returns an error. However, this is also subject to the cluster-wide xpack.ml.max_lazy_ml_nodes setting. If this option is set to true, the open anomaly detection jobs API does not return an error and the job waits in the opening state until sufficient machine learning node capacity is available.

  • analysis_limits – Limits can be applied for the resources required to hold the mathematical models in memory. These limits are approximate and can be set per job. They do not control the memory used by other processes, for example the Elasticsearch Java processes.

  • background_persist_interval – Advanced configuration option. The time between each periodic persistence of the model. The default value is a randomized value between 3 to 4 hours, which avoids all jobs persisting at exactly the same time. The smallest allowed value is 1 hour. For very large models (several GB), persistence could take 10-20 minutes, so do not set the background_persist_interval value too low.

  • custom_settings – Advanced configuration option. Contains custom meta data about the job.

  • daily_model_snapshot_retention_after_days – Advanced configuration option, which affects the automatic removal of old model snapshots for this job. It specifies a period of time (in days) after which only the first snapshot per day is retained. This period is relative to the timestamp of the most recent snapshot for this job. Valid values range from 0 to model_snapshot_retention_days.

  • datafeed_config – Defines a datafeed for the anomaly detection job. If Elasticsearch security features are enabled, your datafeed remembers which roles the user who created it had at the time of creation and runs the query using those same roles. If you provide secondary authorization headers, those credentials are used instead.

  • description – A description of the job.

  • groups – A list of job groups. A job can belong to no groups or many.

  • model_plot_config – This advanced configuration option stores model information along with the results. It provides a more detailed view into anomaly detection. If you enable model plot it can add considerable overhead to the performance of the system; it is not feasible for jobs with many entities. Model plot provides a simplified and indicative view of the model and its bounds. It does not display complex features such as multivariate correlations or multimodal data. As such, anomalies may occasionally be reported which cannot be seen in the model plot. Model plot config can be configured when the job is created or updated later. It must be disabled if performance issues are experienced.

  • model_snapshot_retention_days – Advanced configuration option, which affects the automatic removal of old model snapshots for this job. It specifies the maximum period of time (in days) that snapshots are retained. This period is relative to the timestamp of the most recent snapshot for this job. By default, snapshots ten days older than the newest snapshot are deleted.

  • renormalization_window_days – Advanced configuration option. The period over which adjustments to the score are applied, as new data is seen. The default value is the longer of 30 days or 100 bucket spans.

  • results_index_name – A text string that affects the name of the machine learning results index. By default, the job generates an index named .ml-anomalies-shared.

  • results_retention_days – Advanced configuration option. The period of time (in days) that results are retained. Age is calculated relative to the timestamp of the latest bucket result. If this property has a non-null value, once per day at 00:30 (server time), results that are the specified number of days older than the latest bucket result are deleted from Elasticsearch. The default value is null, which means all results are retained. Annotations generated by the system also count as results for retention purposes; they are deleted after the same number of days as results. Annotations added by users are retained forever.

put_trained_model(*, model_id: str, compressed_definition: str | None = None, defer_definition_decompression: bool | None = None, definition: Mapping[str, Any] | None = None, description: str | None = None, error_trace: bool | None = None, filter_path: str | Sequence[str] | None = None, human: bool | None = None, inference_config: Mapping[str, Any] | None = None, input: Mapping[str, Any] | None = None, metadata: Any | None = None, model_size_bytes: int | None = None, model_type: Literal['lang_ident', 'pytorch', 'tree_ensemble'] | str | None = None, platform_architecture: str | None = None, prefix_strings: Mapping[str, Any] | None = None, pretty: bool | None = None, tags: Sequence[str] | None = None, wait_for_completion: bool | None = None, body: Dict[str, Any] | None = None) ObjectApiResponse[Any]

Creates an inference trained model.

https://www.elastic.co/guide/en/elasticsearch/reference/master/put-trained-models.html

Parameters:
  • model_id – The unique identifier of the trained model.

  • compressed_definition – The compressed (GZipped and Base64 encoded) inference definition of the model. If compressed_definition is specified, then definition cannot be specified.

  • defer_definition_decompression – If set to true and a compressed_definition is provided, the request defers definition decompression and skips relevant validations.

  • definition – The inference definition for the model. If definition is specified, then compressed_definition cannot be specified.

  • description – A human-readable description of the inference trained model.

  • inference_config – The default configuration for inference. This can be either a regression or classification configuration. It must match the underlying definition.trained_model’s target_type. For pre-packaged models such as ELSER the config is not required.

  • input – The input field names for the model definition.

  • metadata – An object map that contains metadata about the model.

  • model_size_bytes – The estimated memory usage in bytes to keep the trained model in memory. This property is supported only if defer_definition_decompression is true or the model definition is not supplied.

  • model_type – The model type.

  • platform_architecture – The platform architecture (if applicable) of the trained mode. If the model only works on one platform, because it is heavily optimized for a particular processor architecture and OS combination, then this field specifies which. The format of the string must match the platform identifiers used by Elasticsearch, so one of, linux-x86_64, linux-aarch64, darwin-x86_64, darwin-aarch64, or windows-x86_64. For portable models (those that work independent of processor architecture or OS features), leave this field unset.

  • prefix_strings – Optional prefix strings applied at inference

  • tags – An array of tags to organize the model.

  • wait_for_completion – Whether to wait for all child operations (e.g. model download) to complete.

put_trained_model_alias(*, model_id: str, model_alias: str, error_trace: bool | None = None, filter_path: str | Sequence[str] | None = None, human: bool | None = None, pretty: bool | None = None, reassign: bool | None = None) ObjectApiResponse[Any]

Creates a new model alias (or reassigns an existing one) to refer to the trained model

https://www.elastic.co/guide/en/elasticsearch/reference/master/put-trained-models-aliases.html

Parameters:
  • model_id – The identifier for the trained model that the alias refers to.

  • model_alias – The alias to create or update. This value cannot end in numbers.

  • reassign – Specifies whether the alias gets reassigned to the specified trained model if it is already assigned to a different model. If the alias is already assigned and this parameter is false, the API returns an error.

put_trained_model_definition_part(*, model_id: str, part: int, definition: str | None = None, total_definition_length: int | None = None, total_parts: int | None = None, error_trace: bool | None = None, filter_path: str | Sequence[str] | None = None, human: bool | None = None, pretty: bool | None = None, body: Dict[str, Any] | None = None) ObjectApiResponse[Any]

Creates part of a trained model definition

https://www.elastic.co/guide/en/elasticsearch/reference/master/put-trained-model-definition-part.html

Parameters:
  • model_id – The unique identifier of the trained model.

  • part – The definition part number. When the definition is loaded for inference the definition parts are streamed in the order of their part number. The first part must be 0 and the final part must be total_parts - 1.

  • definition – The definition part for the model. Must be a base64 encoded string.

  • total_definition_length – The total uncompressed definition length in bytes. Not base64 encoded.

  • total_parts – The total number of parts that will be uploaded. Must be greater than 0.

put_trained_model_vocabulary(*, model_id: str, vocabulary: Sequence[str] | None = None, error_trace: bool | None = None, filter_path: str | Sequence[str] | None = None, human: bool | None = None, merges: Sequence[str] | None = None, pretty: bool | None = None, scores: Sequence[float] | None = None, body: Dict[str, Any] | None = None) ObjectApiResponse[Any]

Creates a trained model vocabulary

https://www.elastic.co/guide/en/elasticsearch/reference/master/put-trained-model-vocabulary.html

Parameters:
  • model_id – The unique identifier of the trained model.

  • vocabulary – The model vocabulary, which must not be empty.

  • merges – The optional model merges if required by the tokenizer.

  • scores – The optional vocabulary value scores if required by the tokenizer.

reset_job(*, job_id: str, delete_user_annotations: bool | None = None, error_trace: bool | None = None, filter_path: str | Sequence[str] | None = None, human: bool | None = None, pretty: bool | None = None, wait_for_completion: bool | None = None) ObjectApiResponse[Any]

Resets an existing anomaly detection job.

https://www.elastic.co/guide/en/elasticsearch/reference/master/ml-reset-job.html

Parameters:
  • job_id – The ID of the job to reset.

  • delete_user_annotations – Specifies whether annotations that have been added by the user should be deleted along with any auto-generated annotations when the job is reset.

  • wait_for_completion – Should this request wait until the operation has completed before returning.

start_data_frame_analytics(*, id: str, error_trace: bool | None = None, filter_path: str | Sequence[str] | None = None, human: bool | None = None, pretty: bool | None = None, timeout: Literal[0] | str | None = None) ObjectApiResponse[Any]

Starts a data frame analytics job.

https://www.elastic.co/guide/en/elasticsearch/reference/master/start-dfanalytics.html

Parameters:
  • id – Identifier for the data frame analytics job. This identifier can contain lowercase alphanumeric characters (a-z and 0-9), hyphens, and underscores. It must start and end with alphanumeric characters.

  • timeout – Controls the amount of time to wait until the data frame analytics job starts.

start_datafeed(*, datafeed_id: str, end: str | Any | None = None, error_trace: bool | None = None, filter_path: str | Sequence[str] | None = None, human: bool | None = None, pretty: bool | None = None, start: str | Any | None = None, timeout: Literal[0] | str | None = None, body: Dict[str, Any] | None = None) ObjectApiResponse[Any]

Starts one or more datafeeds.

https://www.elastic.co/guide/en/elasticsearch/reference/master/ml-start-datafeed.html

Parameters:
  • datafeed_id – A numerical character string that uniquely identifies the datafeed. This identifier can contain lowercase alphanumeric characters (a-z and 0-9), hyphens, and underscores. It must start and end with alphanumeric characters.

  • end – Refer to the description for the end query parameter.

  • start – Refer to the description for the start query parameter.

  • timeout – Refer to the description for the timeout query parameter.

start_trained_model_deployment(*, model_id: str, cache_size: int | str | None = None, deployment_id: str | None = None, error_trace: bool | None = None, filter_path: str | Sequence[str] | None = None, human: bool | None = None, number_of_allocations: int | None = None, pretty: bool | None = None, priority: Literal['low', 'normal'] | str | None = None, queue_capacity: int | None = None, threads_per_allocation: int | None = None, timeout: Literal[0] | str | None = None, wait_for: Literal['fully_allocated', 'started', 'starting'] | str | None = None) ObjectApiResponse[Any]

Start a trained model deployment.

https://www.elastic.co/guide/en/elasticsearch/reference/master/start-trained-model-deployment.html

Parameters:
  • model_id – The unique identifier of the trained model. Currently, only PyTorch models are supported.

  • cache_size – The inference cache size (in memory outside the JVM heap) per node for the model. The default value is the same size as the model_size_bytes. To disable the cache, 0b can be provided.

  • deployment_id – A unique identifier for the deployment of the model.

  • number_of_allocations – The number of model allocations on each node where the model is deployed. All allocations on a node share the same copy of the model in memory but use a separate set of threads to evaluate the model. Increasing this value generally increases the throughput. If this setting is greater than the number of hardware threads it will automatically be changed to a value less than the number of hardware threads.

  • priority – The deployment priority.

  • queue_capacity – Specifies the number of inference requests that are allowed in the queue. After the number of requests exceeds this value, new requests are rejected with a 429 error.

  • threads_per_allocation – Sets the number of threads used by each model allocation during inference. This generally increases the inference speed. The inference process is a compute-bound process; any number greater than the number of available hardware threads on the machine does not increase the inference speed. If this setting is greater than the number of hardware threads it will automatically be changed to a value less than the number of hardware threads.

  • timeout – Specifies the amount of time to wait for the model to deploy.

  • wait_for – Specifies the allocation status to wait for before returning.

stop_data_frame_analytics(*, id: str, allow_no_match: bool | None = None, error_trace: bool | None = None, filter_path: str | Sequence[str] | None = None, force: bool | None = None, human: bool | None = None, pretty: bool | None = None, timeout: Literal[0] | str | None = None) ObjectApiResponse[Any]

Stops one or more data frame analytics jobs.

https://www.elastic.co/guide/en/elasticsearch/reference/master/stop-dfanalytics.html

Parameters:
  • id – Identifier for the data frame analytics job. This identifier can contain lowercase alphanumeric characters (a-z and 0-9), hyphens, and underscores. It must start and end with alphanumeric characters.

  • allow_no_match – Specifies what to do when the request: 1. Contains wildcard expressions and there are no data frame analytics jobs that match. 2. Contains the _all string or no identifiers and there are no matches. 3. Contains wildcard expressions and there are only partial matches. The default value is true, which returns an empty data_frame_analytics array when there are no matches and the subset of results when there are partial matches. If this parameter is false, the request returns a 404 status code when there are no matches or only partial matches.

  • force – If true, the data frame analytics job is stopped forcefully.

  • timeout – Controls the amount of time to wait until the data frame analytics job stops. Defaults to 20 seconds.

stop_datafeed(*, datafeed_id: str, allow_no_match: bool | None = None, error_trace: bool | None = None, filter_path: str | Sequence[str] | None = None, force: bool | None = None, human: bool | None = None, pretty: bool | None = None, timeout: Literal[0] | str | None = None, body: Dict[str, Any] | None = None) ObjectApiResponse[Any]

Stops one or more datafeeds.

https://www.elastic.co/guide/en/elasticsearch/reference/master/ml-stop-datafeed.html

Parameters:
  • datafeed_id – Identifier for the datafeed. You can stop multiple datafeeds in a single API request by using a comma-separated list of datafeeds or a wildcard expression. You can close all datafeeds by using _all or by specifying * as the identifier.

  • allow_no_match – Refer to the description for the allow_no_match query parameter.

  • force – Refer to the description for the force query parameter.

  • timeout – Refer to the description for the timeout query parameter.

stop_trained_model_deployment(*, model_id: str, allow_no_match: bool | None = None, error_trace: bool | None = None, filter_path: str | Sequence[str] | None = None, force: bool | None = None, human: bool | None = None, pretty: bool | None = None) ObjectApiResponse[Any]

Stop a trained model deployment.

https://www.elastic.co/guide/en/elasticsearch/reference/master/stop-trained-model-deployment.html

Parameters:
  • model_id – The unique identifier of the trained model.

  • allow_no_match – Specifies what to do when the request: contains wildcard expressions and there are no deployments that match; contains the _all string or no identifiers and there are no matches; or contains wildcard expressions and there are only partial matches. By default, it returns an empty array when there are no matches and the subset of results when there are partial matches. If false, the request returns a 404 status code when there are no matches or only partial matches.

  • force – Forcefully stops the deployment, even if it is used by ingest pipelines. You can’t use these pipelines until you restart the model deployment.

update_data_frame_analytics(*, id: str, allow_lazy_start: bool | None = None, description: str | None = None, error_trace: bool | None = None, filter_path: str | Sequence[str] | None = None, human: bool | None = None, max_num_threads: int | None = None, model_memory_limit: str | None = None, pretty: bool | None = None, body: Dict[str, Any] | None = None) ObjectApiResponse[Any]

Updates certain properties of a data frame analytics job.

https://www.elastic.co/guide/en/elasticsearch/reference/master/update-dfanalytics.html

Parameters:
  • id – Identifier for the data frame analytics job. This identifier can contain lowercase alphanumeric characters (a-z and 0-9), hyphens, and underscores. It must start and end with alphanumeric characters.

  • allow_lazy_start – Specifies whether this job can start when there is insufficient machine learning node capacity for it to be immediately assigned to a node.

  • description – A description of the job.

  • max_num_threads – The maximum number of threads to be used by the analysis. Using more threads may decrease the time necessary to complete the analysis at the cost of using more CPU. Note that the process may use additional threads for operational functionality other than the analysis itself.

  • model_memory_limit – The approximate maximum amount of memory resources that are permitted for analytical processing. If your elasticsearch.yml file contains an xpack.ml.max_model_memory_limit setting, an error occurs when you try to create data frame analytics jobs that have model_memory_limit values greater than that setting.

update_datafeed(*, datafeed_id: str, aggregations: Mapping[str, Mapping[str, Any]] | None = None, allow_no_indices: bool | None = None, chunking_config: Mapping[str, Any] | None = None, delayed_data_check_config: Mapping[str, Any] | None = None, error_trace: bool | None = None, expand_wildcards: Sequence[Literal['all', 'closed', 'hidden', 'none', 'open'] | str] | Literal['all', 'closed', 'hidden', 'none', 'open'] | str | None = None, filter_path: str | Sequence[str] | None = None, frequency: Literal[0] | str | None = None, human: bool | None = None, ignore_throttled: bool | None = None, ignore_unavailable: bool | None = None, indexes: Sequence[str] | None = None, indices: Sequence[str] | None = None, indices_options: Mapping[str, Any] | None = None, job_id: str | None = None, max_empty_searches: int | None = None, pretty: bool | None = None, query: Mapping[str, Any] | None = None, query_delay: Literal[0] | str | None = None, runtime_mappings: Mapping[str, Mapping[str, Any]] | None = None, script_fields: Mapping[str, Mapping[str, Any]] | None = None, scroll_size: int | None = None, body: Dict[str, Any] | None = None) ObjectApiResponse[Any]

Updates certain properties of a datafeed.

https://www.elastic.co/guide/en/elasticsearch/reference/master/ml-update-datafeed.html

Parameters:
  • datafeed_id – A numerical character string that uniquely identifies the datafeed. This identifier can contain lowercase alphanumeric characters (a-z and 0-9), hyphens, and underscores. It must start and end with alphanumeric characters.

  • aggregations – If set, the datafeed performs aggregation searches. Support for aggregations is limited and should be used only with low cardinality data.

  • allow_no_indices – If true, wildcard indices expressions that resolve into no concrete indices are ignored. This includes the _all string or when no indices are specified.

  • chunking_config – Datafeeds might search over long time periods, for several months or years. This search is split into time chunks in order to ensure the load on Elasticsearch is managed. Chunking configuration controls how the size of these time chunks are calculated; it is an advanced configuration option.

  • delayed_data_check_config – Specifies whether the datafeed checks for missing data and the size of the window. The datafeed can optionally search over indices that have already been read in an effort to determine whether any data has subsequently been added to the index. If missing data is found, it is a good indication that the query_delay is set too low and the data is being indexed after the datafeed has passed that moment in time. This check runs only on real-time datafeeds.

  • expand_wildcards – 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. Valid values are: * all: Match any data stream or index, including hidden ones. * closed: Match closed, non-hidden indices. Also matches any non-hidden data stream. Data streams cannot be closed. * hidden: Match hidden data streams and hidden indices. Must be combined with open, closed, or both. * none: Wildcard patterns are not accepted. * open: Match open, non-hidden indices. Also matches any non-hidden data stream.

  • frequency – The interval at which scheduled queries are made while the datafeed runs in real time. The default value is either the bucket span for short bucket spans, or, for longer bucket spans, a sensible fraction of the bucket span. When frequency is shorter than the bucket span, interim results for the last (partial) bucket are written then eventually overwritten by the full bucket results. If the datafeed uses aggregations, this value must be divisible by the interval of the date histogram aggregation.

  • ignore_throttled – If true, concrete, expanded or aliased indices are ignored when frozen.

  • ignore_unavailable – If true, unavailable indices (missing or closed) are ignored.

  • indexes – An array of index names. Wildcards are supported. If any of the indices are in remote clusters, the machine learning nodes must have the remote_cluster_client role.

  • indices – An array of index names. Wildcards are supported. If any of the indices are in remote clusters, the machine learning nodes must have the remote_cluster_client role.

  • indices_options – Specifies index expansion options that are used during search.

  • job_id

  • max_empty_searches – If a real-time datafeed has never seen any data (including during any initial training period), it automatically stops and closes the associated job after this many real-time searches return no documents. In other words, it stops after frequency times max_empty_searches of real-time operation. If not set, a datafeed with no end time that sees no data remains started until it is explicitly stopped. By default, it is not set.

  • query – The Elasticsearch query domain-specific language (DSL). This value corresponds to the query object in an Elasticsearch search POST body. All the options that are supported by Elasticsearch can be used, as this object is passed verbatim to Elasticsearch. Note that if you change the query, the analyzed data is also changed. Therefore, the time required to learn might be long and the understandability of the results is unpredictable. If you want to make significant changes to the source data, it is recommended that you clone the job and datafeed and make the amendments in the clone. Let both run in parallel and close one when you are satisfied with the results of the job.

  • query_delay – The number of seconds behind real time that data is queried. For example, if data from 10:04 a.m. might not be searchable in Elasticsearch until 10:06 a.m., set this property to 120 seconds. The default value is randomly selected between 60s and 120s. This randomness improves the query performance when there are multiple jobs running on the same node.

  • runtime_mappings – Specifies runtime fields for the datafeed search.

  • script_fields – Specifies scripts that evaluate custom expressions and returns script fields to the datafeed. The detector configuration objects in a job can contain functions that use these script fields.

  • scroll_size – The size parameter that is used in Elasticsearch searches when the datafeed does not use aggregations. The maximum value is the value of index.max_result_window.

update_filter(*, filter_id: str, add_items: Sequence[str] | None = None, description: str | None = None, error_trace: bool | None = None, filter_path: str | Sequence[str] | None = None, human: bool | None = None, pretty: bool | None = None, remove_items: Sequence[str] | None = None, body: Dict[str, Any] | None = None) ObjectApiResponse[Any]

Updates the description of a filter, adds items, or removes items.

https://www.elastic.co/guide/en/elasticsearch/reference/master/ml-update-filter.html

Parameters:
  • filter_id – A string that uniquely identifies a filter.

  • add_items – The items to add to the filter.

  • description – A description for the filter.

  • remove_items – The items to remove from the filter.

update_job(*, job_id: str, allow_lazy_open: bool | None = None, analysis_limits: Mapping[str, Any] | None = None, background_persist_interval: Literal[0] | str | None = None, categorization_filters: Sequence[str] | None = None, custom_settings: Mapping[str, Any] | None = None, daily_model_snapshot_retention_after_days: int | None = None, description: str | None = None, detectors: Sequence[Mapping[str, Any]] | None = None, error_trace: bool | None = None, filter_path: str | Sequence[str] | None = None, groups: Sequence[str] | None = None, human: bool | None = None, model_plot_config: Mapping[str, Any] | None = None, model_prune_window: Literal[0] | str | None = None, model_snapshot_retention_days: int | None = None, per_partition_categorization: Mapping[str, Any] | None = None, pretty: bool | None = None, renormalization_window_days: int | None = None, results_retention_days: int | None = None, body: Dict[str, Any] | None = None) ObjectApiResponse[Any]

Updates certain properties of an anomaly detection job.

https://www.elastic.co/guide/en/elasticsearch/reference/master/ml-update-job.html

Parameters:
  • job_id – Identifier for the job.

  • allow_lazy_open – Advanced configuration option. Specifies whether this job can open when there is insufficient machine learning node capacity for it to be immediately assigned to a node. If false and a machine learning node with capacity to run the job cannot immediately be found, the open anomaly detection jobs API returns an error. However, this is also subject to the cluster-wide xpack.ml.max_lazy_ml_nodes setting. If this option is set to true, the open anomaly detection jobs API does not return an error and the job waits in the opening state until sufficient machine learning node capacity is available.

  • analysis_limits

  • background_persist_interval – Advanced configuration option. The time between each periodic persistence of the model. The default value is a randomized value between 3 to 4 hours, which avoids all jobs persisting at exactly the same time. The smallest allowed value is 1 hour. For very large models (several GB), persistence could take 10-20 minutes, so do not set the value too low. If the job is open when you make the update, you must stop the datafeed, close the job, then reopen the job and restart the datafeed for the changes to take effect.

  • categorization_filters

  • custom_settings – Advanced configuration option. Contains custom meta data about the job. For example, it can contain custom URL information as shown in Adding custom URLs to machine learning results.

  • daily_model_snapshot_retention_after_days – Advanced configuration option, which affects the automatic removal of old model snapshots for this job. It specifies a period of time (in days) after which only the first snapshot per day is retained. This period is relative to the timestamp of the most recent snapshot for this job. Valid values range from 0 to model_snapshot_retention_days. For jobs created before version 7.8.0, the default value matches model_snapshot_retention_days.

  • description – A description of the job.

  • detectors – An array of detector update objects.

  • groups – A list of job groups. A job can belong to no groups or many.

  • model_plot_config

  • model_prune_window

  • model_snapshot_retention_days – Advanced configuration option, which affects the automatic removal of old model snapshots for this job. It specifies the maximum period of time (in days) that snapshots are retained. This period is relative to the timestamp of the most recent snapshot for this job.

  • per_partition_categorization – Settings related to how categorization interacts with partition fields.

  • renormalization_window_days – Advanced configuration option. The period over which adjustments to the score are applied, as new data is seen.

  • results_retention_days – Advanced configuration option. The period of time (in days) that results are retained. Age is calculated relative to the timestamp of the latest bucket result. If this property has a non-null value, once per day at 00:30 (server time), results that are the specified number of days older than the latest bucket result are deleted from Elasticsearch. The default value is null, which means all results are retained.

Monitoring

Security

class elasticsearch_serverless.client.SecurityClient(client: BaseClient)
authenticate(*, error_trace: bool | None = None, filter_path: str | Sequence[str] | None = None, human: bool | None = None, pretty: bool | None = None) ObjectApiResponse[Any]

Enables authentication as a user and retrieve information about the authenticated user.

https://www.elastic.co/guide/en/elasticsearch/reference/master/security-api-authenticate.html

create_api_key(*, error_trace: bool | None = None, expiration: Literal[0] | str | None = None, filter_path: str | Sequence[str] | None = None, human: bool | None = None, metadata: Mapping[str, Any] | None = None, name: str | None = None, pretty: bool | None = None, refresh: Literal['false', 'true', 'wait_for'] | bool | str | None = None, role_descriptors: Mapping[str, Mapping[str, Any]] | None = None, body: Dict[str, Any] | None = None) ObjectApiResponse[Any]

Creates an API key for access without requiring basic authentication.

https://www.elastic.co/guide/en/elasticsearch/reference/master/security-api-create-api-key.html

Parameters:
  • expiration – Expiration time for the API key. By default, API keys never expire.

  • metadata – Arbitrary metadata that you want to associate with the API key. It supports nested data structure. Within the metadata object, keys beginning with _ are reserved for system usage.

  • name – Specifies the name for this API key.

  • refresh – If true (the default) then refresh the affected shards to make this operation visible to search, if wait_for then wait for a refresh to make this operation visible to search, if false then do nothing with refreshes.

  • role_descriptors – An array of role descriptors for this API key. This parameter is optional. When it is not specified or is an empty array, then the API key will have a point in time snapshot of permissions of the authenticated user. If you supply role descriptors then the resultant permissions would be an intersection of API keys permissions and authenticated user’s permissions thereby limiting the access scope for API keys. The structure of role descriptor is the same as the request for create role API. For more details, see create or update roles API.

get_api_key(*, active_only: bool | None = None, error_trace: bool | None = None, filter_path: str | Sequence[str] | None = None, human: bool | None = None, id: str | None = None, name: str | None = None, owner: bool | None = None, pretty: bool | None = None, realm_name: str | None = None, username: str | None = None, with_limited_by: bool | None = None, with_profile_uid: bool | None = None) ObjectApiResponse[Any]

Retrieves information for one or more API keys.

https://www.elastic.co/guide/en/elasticsearch/reference/master/security-api-get-api-key.html

Parameters:
  • active_only – A boolean flag that can be used to query API keys that are currently active. An API key is considered active if it is neither invalidated, nor expired at query time. You can specify this together with other parameters such as owner or name. If active_only is false, the response will include both active and inactive (expired or invalidated) keys.

  • id – An API key id. This parameter cannot be used with any of name, realm_name or username.

  • name – An API key name. This parameter cannot be used with any of id, realm_name or username. It supports prefix search with wildcard.

  • owner – A boolean flag that can be used to query API keys owned by the currently authenticated user. The realm_name or username parameters cannot be specified when this parameter is set to true as they are assumed to be the currently authenticated ones.

  • realm_name – The name of an authentication realm. This parameter cannot be used with either id or name or when owner flag is set to true.

  • username – The username of a user. This parameter cannot be used with either id or name or when owner flag is set to true.

  • with_limited_by – Return the snapshot of the owner user’s role descriptors associated with the API key. An API key’s actual permission is the intersection of its assigned role descriptors and the owner user’s role descriptors.

  • with_profile_uid – Determines whether to also retrieve the profile uid, for the API key owner principal, if it exists.

has_privileges(*, user: str | None = None, application: Sequence[Mapping[str, Any]] | None = None, cluster: Sequence[Literal['all', 'cancel_task', 'create_snapshot', 'grant_api_key', 'manage', 'manage_api_key', 'manage_ccr', 'manage_enrich', 'manage_ilm', 'manage_index_templates', 'manage_ingest_pipelines', 'manage_logstash_pipelines', 'manage_ml', 'manage_oidc', 'manage_own_api_key', 'manage_pipeline', 'manage_rollup', 'manage_saml', 'manage_security', 'manage_service_account', 'manage_slm', 'manage_token', 'manage_transform', 'manage_user_profile', 'manage_watcher', 'monitor', 'monitor_ml', 'monitor_rollup', 'monitor_snapshot', 'monitor_text_structure', 'monitor_transform', 'monitor_watcher', 'read_ccr', 'read_ilm', 'read_pipeline', 'read_slm', 'transport_client'] | str] | None = None, error_trace: bool | None = None, filter_path: str | Sequence[str] | None = None, human: bool | None = None, index: Sequence[Mapping[str, Any]] | None = None, pretty: bool | None = None, body: Dict[str, Any] | None = None) ObjectApiResponse[Any]

Determines whether the specified user has a specified list of privileges.

https://www.elastic.co/guide/en/elasticsearch/reference/master/security-api-has-privileges.html

Parameters:
  • user – Username

  • application

  • cluster – A list of the cluster privileges that you want to check.

  • index

invalidate_api_key(*, error_trace: bool | None = None, filter_path: str | Sequence[str] | None = None, human: bool | None = None, id: str | None = None, ids: Sequence[str] | None = None, name: str | None = None, owner: bool | None = None, pretty: bool | None = None, realm_name: str | None = None, username: str | None = None, body: Dict[str, Any] | None = None) ObjectApiResponse[Any]

Invalidates one or more API keys.

https://www.elastic.co/guide/en/elasticsearch/reference/master/security-api-invalidate-api-key.html

Parameters:
  • id

  • ids – A list of API key ids. This parameter cannot be used with any of name, realm_name, or username.

  • name – An API key name. This parameter cannot be used with any of ids, realm_name or username.

  • owner – Can be used to query API keys owned by the currently authenticated user. The realm_name or username parameters cannot be specified when this parameter is set to true as they are assumed to be the currently authenticated ones.

  • realm_name – The name of an authentication realm. This parameter cannot be used with either ids or name, or when owner flag is set to true.

  • username – The username of a user. This parameter cannot be used with either ids or name, or when owner flag is set to true.

query_api_keys(*, aggregations: Mapping[str, Mapping[str, Any]] | None = None, aggs: Mapping[str, Mapping[str, Any]] | None = None, error_trace: bool | None = None, filter_path: str | Sequence[str] | None = None, from_: int | None = None, human: bool | None = None, pretty: bool | None = None, query: Mapping[str, Any] | None = None, search_after: Sequence[None | bool | float | int | str | Any] | None = None, size: int | None = None, sort: Sequence[str | Mapping[str, Any]] | str | Mapping[str, Any] | None = None, typed_keys: bool | None = None, with_limited_by: bool | None = None, with_profile_uid: bool | None = None, body: Dict[str, Any] | None = None) ObjectApiResponse[Any]

Retrieves information for API keys using a subset of query DSL

https://www.elastic.co/guide/en/elasticsearch/reference/master/security-api-query-api-key.html

Parameters:
  • aggregations – Any aggregations to run over the corpus of returned API keys. Aggregations and queries work together. Aggregations are computed only on the API keys that match the query. This supports only a subset of aggregation types, namely: terms, range, date_range, missing, cardinality, value_count, composite, filter, and filters. Additionally, aggregations only run over the same subset of fields that query works with.

  • aggs – Any aggregations to run over the corpus of returned API keys. Aggregations and queries work together. Aggregations are computed only on the API keys that match the query. This supports only a subset of aggregation types, namely: terms, range, date_range, missing, cardinality, value_count, composite, filter, and filters. Additionally, aggregations only run over the same subset of fields that query works with.

  • from – Starting document offset. By default, you cannot page through more than 10,000 hits using the from and size parameters. To page through more hits, use the search_after parameter.

  • query – A query to filter which API keys to return. If the query parameter is missing, it is equivalent to a match_all query. The query supports a subset of query types, including match_all, bool, term, terms, match, ids, prefix, wildcard, exists, range, and simple_query_string. You can query the following public information associated with an API key: id, type, name, creation, expiration, invalidated, invalidation, username, realm, and metadata.

  • search_after – Search after definition

  • size – The number of hits to return. By default, you cannot page through more than 10,000 hits using the from and size parameters. To page through more hits, use the search_after parameter.

  • sort – Other than id, all public fields of an API key are eligible for sorting. In addition, sort can also be applied to the _doc field to sort by index order.

  • typed_keys – Determines whether aggregation names are prefixed by their respective types in the response.

  • with_limited_by – Return the snapshot of the owner user’s role descriptors associated with the API key. An API key’s actual permission is the intersection of its assigned role descriptors and the owner user’s role descriptors.

  • with_profile_uid – Determines whether to also retrieve the profile uid, for the API key owner principal, if it exists.

update_api_key(*, id: str, error_trace: bool | None = None, expiration: Literal[0] | str | None = None, filter_path: str | Sequence[str] | None = None, human: bool | None = None, metadata: Mapping[str, Any] | None = None, pretty: bool | None = None, role_descriptors: Mapping[str, Mapping[str, Any]] | None = None, body: Dict[str, Any] | None = None) ObjectApiResponse[Any]

Updates attributes of an existing API key.

https://www.elastic.co/guide/en/elasticsearch/reference/master/security-api-update-api-key.html

Parameters:
  • id – The ID of the API key to update.

  • expiration – Expiration time for the API key.

  • metadata – Arbitrary metadata that you want to associate with the API key. It supports nested data structure. Within the metadata object, keys beginning with _ are reserved for system usage.

  • role_descriptors – An array of role descriptors for this API key. This parameter is optional. When it is not specified or is an empty array, then the API key will have a point in time snapshot of permissions of the authenticated user. If you supply role descriptors then the resultant permissions would be an intersection of API keys permissions and authenticated user’s permissions thereby limiting the access scope for API keys. The structure of role descriptor is the same as the request for create role API. For more details, see create or update roles API.

SQL

class elasticsearch_serverless.client.SqlClient(client: BaseClient)
clear_cursor(*, cursor: str | None = None, error_trace: bool | None = None, filter_path: str | Sequence[str] | None = None, human: bool | None = None, pretty: bool | None = None, body: Dict[str, Any] | None = None) ObjectApiResponse[Any]

Clears the SQL cursor

https://www.elastic.co/guide/en/elasticsearch/reference/master/clear-sql-cursor-api.html

Parameters:

cursor – Cursor to clear.

delete_async(*, id: str, error_trace: bool | None = None, filter_path: str | Sequence[str] | None = None, human: bool | None = None, pretty: bool | None = None) ObjectApiResponse[Any]

Deletes an async SQL search or a stored synchronous SQL search. If the search is still running, the API cancels it.

https://www.elastic.co/guide/en/elasticsearch/reference/master/delete-async-sql-search-api.html

Parameters:

id – Identifier for the search.

get_async(*, id: str, delimiter: str | None = None, error_trace: bool | None = None, filter_path: str | Sequence[str] | None = None, format: str | None = None, human: bool | None = None, keep_alive: Literal[0] | str | None = None, pretty: bool | None = None, wait_for_completion_timeout: Literal[0] | str | None = None) ObjectApiResponse[Any]

Returns the current status and available results for an async SQL search or stored synchronous SQL search

https://www.elastic.co/guide/en/elasticsearch/reference/master/get-async-sql-search-api.html

Parameters:
  • id – Identifier for the search.

  • delimiter – Separator for CSV results. The API only supports this parameter for CSV responses.

  • format – Format for the response. You must specify a format using this parameter or the Accept HTTP header. If you specify both, the API uses this parameter.

  • keep_alive – Retention period for the search and its results. Defaults to the keep_alive period for the original SQL search.

  • wait_for_completion_timeout – Period to wait for complete results. Defaults to no timeout, meaning the request waits for complete search results.

get_async_status(*, id: str, error_trace: bool | None = None, filter_path: str | Sequence[str] | None = None, human: bool | None = None, pretty: bool | None = None) ObjectApiResponse[Any]

Returns the current status of an async SQL search or a stored synchronous SQL search

https://www.elastic.co/guide/en/elasticsearch/reference/master/get-async-sql-search-status-api.html

Parameters:

id – Identifier for the search.

query(*, catalog: str | None = None, columnar: bool | None = None, cursor: str | None = None, error_trace: bool | None = None, fetch_size: int | None = None, field_multi_value_leniency: bool | None = None, filter: Mapping[str, Any] | None = None, filter_path: str | Sequence[str] | None = None, format: str | None = None, human: bool | None = None, index_using_frozen: bool | None = None, keep_alive: Literal[0] | str | None = None, keep_on_completion: bool | None = None, page_timeout: Literal[0] | str | None = None, params: Mapping[str, Any] | None = None, pretty: bool | None = None, query: str | None = None, request_timeout: Literal[0] | str | None = None, runtime_mappings: Mapping[str, Mapping[str, Any]] | None = None, time_zone: str | None = None, wait_for_completion_timeout: Literal[0] | str | None = None, body: Dict[str, Any] | None = None) ObjectApiResponse[Any]

Executes a SQL request

https://www.elastic.co/guide/en/elasticsearch/reference/master/sql-search-api.html

Parameters:
  • catalog – Default catalog (cluster) for queries. If unspecified, the queries execute on the data in the local cluster only.

  • columnar – If true, the results in a columnar fashion: one row represents all the values of a certain column from the current page of results.

  • cursor – Cursor used to retrieve a set of paginated results. If you specify a cursor, the API only uses the columnar and time_zone request body parameters. It ignores other request body parameters.

  • fetch_size – The maximum number of rows (or entries) to return in one response

  • field_multi_value_leniency – Throw an exception when encountering multiple values for a field (default) or be lenient and return the first value from the list (without any guarantees of what that will be - typically the first in natural ascending order).

  • filter – Elasticsearch query DSL for additional filtering.

  • format – Format for the response.

  • index_using_frozen – If true, the search can run on frozen indices. Defaults to false.

  • keep_alive – Retention period for an async or saved synchronous search.

  • keep_on_completion – If true, Elasticsearch stores synchronous searches if you also specify the wait_for_completion_timeout parameter. If false, Elasticsearch only stores async searches that don’t finish before the wait_for_completion_timeout.

  • page_timeout – The timeout before a pagination request fails.

  • params – Values for parameters in the query.

  • query – SQL query to run.

  • request_timeout – The timeout before the request fails.

  • runtime_mappings – Defines one or more runtime fields in the search request. These fields take precedence over mapped fields with the same name.

  • time_zone – ISO-8601 time zone ID for the search.

  • wait_for_completion_timeout – Period to wait for complete results. Defaults to no timeout, meaning the request waits for complete search results. If the search doesn’t finish within this period, the search becomes async.

translate(*, query: str | None = None, error_trace: bool | None = None, fetch_size: int | None = None, filter: Mapping[str, Any] | None = None, filter_path: str | Sequence[str] | None = None, human: bool | None = None, pretty: bool | None = None, time_zone: str | None = None, body: Dict[str, Any] | None = None) ObjectApiResponse[Any]

Translates SQL into Elasticsearch queries

https://www.elastic.co/guide/en/elasticsearch/reference/master/sql-translate-api.html

Parameters:
  • query – SQL query to run.

  • fetch_size – The maximum number of rows (or entries) to return in one response.

  • filter – Elasticsearch query DSL for additional filtering.

  • time_zone – ISO-8601 time zone ID for the search.

Tasks

class elasticsearch_serverless.client.TasksClient(client: BaseClient)
get(*, task_id: str, error_trace: bool | None = None, filter_path: str | Sequence[str] | None = None, human: bool | None = None, pretty: bool | None = None, timeout: Literal[0] | str | None = None, wait_for_completion: bool | None = None) ObjectApiResponse[Any]

Returns information about a task.

https://www.elastic.co/guide/en/elasticsearch/reference/master/tasks.html

Parameters:
  • task_id – ID of the task.

  • timeout – Period to wait for a response. If no response is received before the timeout expires, the request fails and returns an error.

  • wait_for_completion – If true, the request blocks until the task has completed.

Transforms

class elasticsearch_serverless.client.TransformClient(client: BaseClient)
delete_transform(*, transform_id: str, delete_dest_index: bool | None = None, error_trace: bool | None = None, filter_path: str | Sequence[str] | None = None, force: bool | None = None, human: bool | None = None, pretty: bool | None = None, timeout: Literal[0] | str | None = None) ObjectApiResponse[Any]

Deletes an existing transform.

https://www.elastic.co/guide/en/elasticsearch/reference/master/delete-transform.html

Parameters:
  • transform_id – Identifier for the transform.

  • delete_dest_index – If this value is true, the destination index is deleted together with the transform. If false, the destination index will not be deleted

  • force – If this value is false, the transform must be stopped before it can be deleted. If true, the transform is deleted regardless of its current state.

  • timeout – Period to wait for a response. If no response is received before the timeout expires, the request fails and returns an error.

get_transform(*, transform_id: str | Sequence[str] | None = None, allow_no_match: bool | None = None, error_trace: bool | None = None, exclude_generated: bool | None = None, filter_path: str | Sequence[str] | None = None, from_: int | None = None, human: bool | None = None, pretty: bool | None = None, size: int | None = None) ObjectApiResponse[Any]

Retrieves configuration information for transforms.

https://www.elastic.co/guide/en/elasticsearch/reference/master/get-transform.html

Parameters:
  • transform_id – Identifier for the transform. It can be a transform identifier or a wildcard expression. You can get information for all transforms by using _all, by specifying * as the <transform_id>, or by omitting the <transform_id>.

  • allow_no_match – Specifies what to do when the request: 1. Contains wildcard expressions and there are no transforms that match. 2. Contains the _all string or no identifiers and there are no matches. 3. Contains wildcard expressions and there are only partial matches. If this parameter is false, the request returns a 404 status code when there are no matches or only partial matches.

  • exclude_generated – Excludes fields that were automatically added when creating the transform. This allows the configuration to be in an acceptable format to be retrieved and then added to another cluster.

  • from – Skips the specified number of transforms.

  • size – Specifies the maximum number of transforms to obtain.

get_transform_stats(*, transform_id: str | Sequence[str], allow_no_match: bool | None = None, error_trace: bool | None = None, filter_path: str | Sequence[str] | None = None, from_: int | None = None, human: bool | None = None, pretty: bool | None = None, size: int | None = None, timeout: Literal[0] | str | None = None) ObjectApiResponse[Any]

Retrieves usage information for transforms.

https://www.elastic.co/guide/en/elasticsearch/reference/master/get-transform-stats.html

Parameters:
  • transform_id – Identifier for the transform. It can be a transform identifier or a wildcard expression. You can get information for all transforms by using _all, by specifying * as the <transform_id>, or by omitting the <transform_id>.

  • allow_no_match – Specifies what to do when the request: 1. Contains wildcard expressions and there are no transforms that match. 2. Contains the _all string or no identifiers and there are no matches. 3. Contains wildcard expressions and there are only partial matches. If this parameter is false, the request returns a 404 status code when there are no matches or only partial matches.

  • from – Skips the specified number of transforms.

  • size – Specifies the maximum number of transforms to obtain.

  • timeout – Controls the time to wait for the stats

preview_transform(*, transform_id: str | None = None, description: str | None = None, dest: Mapping[str, Any] | None = None, error_trace: bool | None = None, filter_path: str | Sequence[str] | None = None, frequency: Literal[0] | str | None = None, human: bool | None = None, latest: Mapping[str, Any] | None = None, pivot: Mapping[str, Any] | None = None, pretty: bool | None = None, retention_policy: Mapping[str, Any] | None = None, settings: Mapping[str, Any] | None = None, source: Mapping[str, Any] | None = None, sync: Mapping[str, Any] | None = None, timeout: Literal[0] | str | None = None, body: Dict[str, Any] | None = None) ObjectApiResponse[Any]

Previews a transform.

https://www.elastic.co/guide/en/elasticsearch/reference/master/preview-transform.html

Parameters:
  • transform_id – Identifier for the transform to preview. If you specify this path parameter, you cannot provide transform configuration details in the request body.

  • description – Free text description of the transform.

  • dest – The destination for the transform.

  • frequency – The interval between checks for changes in the source indices when the transform is running continuously. Also determines the retry interval in the event of transient failures while the transform is searching or indexing. The minimum value is 1s and the maximum is 1h.

  • latest – The latest method transforms the data by finding the latest document for each unique key.

  • pivot – The pivot method transforms the data by aggregating and grouping it. These objects define the group by fields and the aggregation to reduce the data.

  • retention_policy – Defines a retention policy for the transform. Data that meets the defined criteria is deleted from the destination index.

  • settings – Defines optional transform settings.

  • source – The source of the data for the transform.

  • sync – Defines the properties transforms require to run continuously.

  • timeout – Period to wait for a response. If no response is received before the timeout expires, the request fails and returns an error.

put_transform(*, transform_id: str, dest: Mapping[str, Any] | None = None, source: Mapping[str, Any] | None = None, defer_validation: bool | None = None, description: str | None = None, error_trace: bool | None = None, filter_path: str | Sequence[str] | None = None, frequency: Literal[0] | str | None = None, human: bool | None = None, latest: Mapping[str, Any] | None = None, meta: Mapping[str, Any] | None = None, pivot: Mapping[str, Any] | None = None, pretty: bool | None = None, retention_policy: Mapping[str, Any] | None = None, settings: Mapping[str, Any] | None = None, sync: Mapping[str, Any] | None = None, timeout: Literal[0] | str | None = None, body: Dict[str, Any] | None = None) ObjectApiResponse[Any]

Instantiates a transform.

https://www.elastic.co/guide/en/elasticsearch/reference/master/put-transform.html

Parameters:
  • transform_id – Identifier for the transform. This identifier can contain lowercase alphanumeric characters (a-z and 0-9), hyphens, and underscores. It has a 64 character limit and must start and end with alphanumeric characters.

  • dest – The destination for the transform.

  • source – The source of the data for the transform.

  • defer_validation – When the transform is created, a series of validations occur to ensure its success. For example, there is a check for the existence of the source indices and a check that the destination index is not part of the source index pattern. You can use this parameter to skip the checks, for example when the source index does not exist until after the transform is created. The validations are always run when you start the transform, however, with the exception of privilege checks.

  • description – Free text description of the transform.

  • frequency – The interval between checks for changes in the source indices when the transform is running continuously. Also determines the retry interval in the event of transient failures while the transform is searching or indexing. The minimum value is 1s and the maximum is 1h.

  • latest – The latest method transforms the data by finding the latest document for each unique key.

  • meta – Defines optional transform metadata.

  • pivot – The pivot method transforms the data by aggregating and grouping it. These objects define the group by fields and the aggregation to reduce the data.

  • retention_policy – Defines a retention policy for the transform. Data that meets the defined criteria is deleted from the destination index.

  • settings – Defines optional transform settings.

  • sync – Defines the properties transforms require to run continuously.

  • timeout – Period to wait for a response. If no response is received before the timeout expires, the request fails and returns an error.

reset_transform(*, transform_id: str, error_trace: bool | None = None, filter_path: str | Sequence[str] | None = None, force: bool | None = None, human: bool | None = None, pretty: bool | None = None) ObjectApiResponse[Any]

Resets an existing transform.

https://www.elastic.co/guide/en/elasticsearch/reference/master/reset-transform.html

Parameters:
  • transform_id – Identifier for the transform. This identifier can contain lowercase alphanumeric characters (a-z and 0-9), hyphens, and underscores. It has a 64 character limit and must start and end with alphanumeric characters.

  • force – If this value is true, the transform is reset regardless of its current state. If it’s false, the transform must be stopped before it can be reset.

schedule_now_transform(*, transform_id: str, error_trace: bool | None = None, filter_path: str | Sequence[str] | None = None, human: bool | None = None, pretty: bool | None = None, timeout: Literal[0] | str | None = None) ObjectApiResponse[Any]

Schedules now a transform.

https://www.elastic.co/guide/en/elasticsearch/reference/master/schedule-now-transform.html

Parameters:
  • transform_id – Identifier for the transform.

  • timeout – Controls the time to wait for the scheduling to take place

start_transform(*, transform_id: str, error_trace: bool | None = None, filter_path: str | Sequence[str] | None = None, from_: str | None = None, human: bool | None = None, pretty: bool | None = None, timeout: Literal[0] | str | None = None) ObjectApiResponse[Any]

Starts one or more transforms.

https://www.elastic.co/guide/en/elasticsearch/reference/master/start-transform.html

Parameters:
  • transform_id – Identifier for the transform.

  • from – Restricts the set of transformed entities to those changed after this time. Relative times like now-30d are supported. Only applicable for continuous transforms.

  • timeout – Period to wait for a response. If no response is received before the timeout expires, the request fails and returns an error.

stop_transform(*, transform_id: str, allow_no_match: bool | None = None, error_trace: bool | None = None, filter_path: str | Sequence[str] | None = None, force: bool | None = None, human: bool | None = None, pretty: bool | None = None, timeout: Literal[0] | str | None = None, wait_for_checkpoint: bool | None = None, wait_for_completion: bool | None = None) ObjectApiResponse[Any]

Stops one or more transforms.

https://www.elastic.co/guide/en/elasticsearch/reference/master/stop-transform.html

Parameters:
  • transform_id – Identifier for the transform. To stop multiple transforms, use a comma-separated list or a wildcard expression. To stop all transforms, use _all or * as the identifier.

  • allow_no_match – Specifies what to do when the request: contains wildcard expressions and there are no transforms that match; contains the _all string or no identifiers and there are no matches; contains wildcard expressions and there are only partial matches. If it is true, the API returns a successful acknowledgement message when there are no matches. When there are only partial matches, the API stops the appropriate transforms. If it is false, the request returns a 404 status code when there are no matches or only partial matches.

  • force – If it is true, the API forcefully stops the transforms.

  • timeout – Period to wait for a response when wait_for_completion is true. If no response is received before the timeout expires, the request returns a timeout exception. However, the request continues processing and eventually moves the transform to a STOPPED state.

  • wait_for_checkpoint – If it is true, the transform does not completely stop until the current checkpoint is completed. If it is false, the transform stops as soon as possible.

  • wait_for_completion – If it is true, the API blocks until the indexer state completely stops. If it is false, the API returns immediately and the indexer is stopped asynchronously in the background.

update_transform(*, transform_id: str, defer_validation: bool | None = None, description: str | None = None, dest: Mapping[str, Any] | None = None, error_trace: bool | None = None, filter_path: str | Sequence[str] | None = None, frequency: Literal[0] | str | None = None, human: bool | None = None, meta: Mapping[str, Any] | None = None, pretty: bool | None = None, retention_policy: None | Mapping[str, Any] = None, settings: Mapping[str, Any] | None = None, source: Mapping[str, Any] | None = None, sync: Mapping[str, Any] | None = None, timeout: Literal[0] | str | None = None, body: Dict[str, Any] | None = None) ObjectApiResponse[Any]

Updates certain properties of a transform.

https://www.elastic.co/guide/en/elasticsearch/reference/master/update-transform.html

Parameters:
  • transform_id – Identifier for the transform.

  • defer_validation – When true, deferrable validations are not run. This behavior may be desired if the source index does not exist until after the transform is created.

  • description – Free text description of the transform.

  • dest – The destination for the transform.

  • frequency – The interval between checks for changes in the source indices when the transform is running continuously. Also determines the retry interval in the event of transient failures while the transform is searching or indexing. The minimum value is 1s and the maximum is 1h.

  • meta – Defines optional transform metadata.

  • retention_policy – Defines a retention policy for the transform. Data that meets the defined criteria is deleted from the destination index.

  • settings – Defines optional transform settings.

  • source – The source of the data for the transform.

  • sync – Defines the properties transforms require to run continuously.

  • timeout – Period to wait for a response. If no response is received before the timeout expires, the request fails and returns an error.