可搜索快照(Searchable Snapshots)

class elasticsearch.client.SearchableSnapshotsClient

To use this client, access client.searchable_snapshots from an Elasticsearch client. For example:

from elasticsearch import Elasticsearch

# Create the client instance
client = Elasticsearch(...)
# Use the searchable_snapshots client
client.searchable_snapshots.<method>(...)
cache_stats(*, node_id=None, error_trace=None, filter_path=None, human=None, master_timeout=None, pretty=None)

获取缓存统计信息。 获取关于部分挂载索引共享缓存的统计信息。

https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-searchable-snapshots-cache-stats

Parameters:
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)

清除缓存。 从部分挂载索引的共享缓存中清除索引和数据流。

https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-searchable-snapshots-clear-cache

Parameters:
  • index (str | Sequence[str] | None) – 要从缓存中清除的数据流、索引和别名的逗号分隔列表。支持通配符(*)。

  • allow_no_indices (bool | None) – 是否忽略通配符索引表达式未解析到具体索引的情况(包括`_all`字符串或未指定索引时)。

  • expand_wildcards (Sequence[str | Literal['all', 'closed', 'hidden', 'none', 'open']] | str | ~typing.Literal['all', 'closed', 'hidden', 'none', 'open'] | None) – 是否将通配符表达式展开为打开的、关闭的或两者兼有的具体索引。

  • ignore_unavailable (bool | None) – 当指定索引不可用时(缺失或关闭)是否忽略这些具体索引

  • 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)

挂载快照。 将快照挂载为可搜索的快照索引。 不要将此API用于由索引生命周期管理(ILM)管理的快照。 手动挂载ILM管理的快照可能会干扰ILM流程。

https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-searchable-snapshots-mount

Parameters:
  • repository (str) – 包含要挂载索引快照的仓库名称。

  • snapshot (str) – 要挂载的索引快照名称。

  • index (str | None) – 快照中包含要挂载数据的索引名称。如果未指定`renamed_index`,此名称也将用于创建新索引。

  • ignore_index_settings (Sequence[str] | None) – 挂载时应从索引中移除的设置名称。

  • index_settings (Mapping[str, Any] | None) – 挂载时应添加到索引中的设置。

  • master_timeout (str | Literal[-1] | ~typing.Literal[0] | None) – 等待主节点的超时时间。如果主节点在超时前不可用,请求将失败并返回错误。设置为`-1`表示永不超时。

  • renamed_index (str | None) – 将被创建的索引名称。

  • storage (str | None) – 可搜索快照索引的挂载选项。

  • wait_for_completion (bool | None) – 如果为true,请求将阻塞直到操作完成。

  • 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)

获取可搜索快照的统计信息。

https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-searchable-snapshots-stats

Parameters:
  • index (str | Sequence[str] | None) – 要检索统计信息的数据流和索引的逗号分隔列表。

  • level (str | Literal['cluster', 'indices', 'shards'] | None) – 返回在集群、索引或分片级别聚合的统计信息

  • error_trace (bool | None)

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

  • human (bool | None)

  • pretty (bool | None)

Return type:

ObjectApiResponse[Any]