Searchable Snapshots

class elasticsearch.client.SearchableSnapshotsClient(client)
Parameters:

client (BaseClient)

cache_stats(*, node_id=None, error_trace=None, filter_path=None, human=None, master_timeout=None, pretty=None)

Get cache statistics. Get statistics about the shared cache for partially mounted indices.

https://www.elastic.co/guide/en/elasticsearch/reference/8.17/searchable-snapshots-api-cache-stats.html

Parameters:
  • node_id (str | Sequence[str] | None) – The names of the nodes in the cluster to target.

  • master_timeout (str | Literal[-1] | ~typing.Literal[0] | None)

  • error_trace (bool | None)

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

  • human (bool | None)

  • pretty (bool | None)

Return type:

ObjectApiResponse[Any]

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

Clear the cache. Clear indices and data streams from the shared cache for partially mounted indices.

https://www.elastic.co/guide/en/elasticsearch/reference/8.17/searchable-snapshots-api-clear-cache.html

Parameters:
  • index (str | Sequence[str] | None) – A comma-separated list of data streams, indices, and aliases to clear from the cache. It supports wildcards (*).

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

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

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

  • error_trace (bool | None)

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

  • human (bool | None)

  • pretty (bool | None)

Return type:

ObjectApiResponse[Any]

mount(*, repository, snapshot, index=None, error_trace=None, filter_path=None, human=None, ignore_index_settings=None, index_settings=None, master_timeout=None, pretty=None, renamed_index=None, storage=None, wait_for_completion=None, body=None)

Mount a snapshot. Mount a snapshot as a searchable snapshot index. Do not use this API for snapshots managed by index lifecycle management (ILM). Manually mounting ILM-managed snapshots can interfere with ILM processes.

https://www.elastic.co/guide/en/elasticsearch/reference/8.17/searchable-snapshots-api-mount-snapshot.html

Parameters:
  • repository (str) – The name of the repository containing the snapshot of the index to mount.

  • snapshot (str) – The name of the snapshot of the index to mount.

  • index (str | None) – The name of the index contained in the snapshot whose data is to be mounted. If no renamed_index is specified, this name will also be used to create the new index.

  • ignore_index_settings (Sequence[str] | None) – The names of settings that should be removed from the index when it is mounted.

  • index_settings (Mapping[str, Any] | None) – The settings that should be added to the index when it is mounted.

  • master_timeout (str | Literal[-1] | ~typing.Literal[0] | None) – The period to wait for the master node. If the master node is not available before the timeout expires, the request fails and returns an error. To indicate that the request should never timeout, set it to -1.

  • renamed_index (str | None) – The name of the index that will be created.

  • storage (str | None) – The mount option for the searchable snapshot index.

  • wait_for_completion (bool | None) – If true, the request blocks until the operation is complete.

  • error_trace (bool | None)

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

  • human (bool | None)

  • pretty (bool | None)

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

Return type:

ObjectApiResponse[Any]

stats(*, index=None, error_trace=None, filter_path=None, human=None, level=None, pretty=None)

Get searchable snapshot statistics.

https://www.elastic.co/guide/en/elasticsearch/reference/8.17/searchable-snapshots-api-stats.html

Parameters:
  • index (str | Sequence[str] | None) – A comma-separated list of data streams and indices to retrieve statistics for.

  • level (str | Literal['cluster', 'indices', 'shards'] | None) – Return stats aggregated at cluster, index or shard level

  • error_trace (bool | None)

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

  • human (bool | None)

  • pretty (bool | None)

Return type:

ObjectApiResponse[Any]