Elasticsearch Python API获取索引统计信息

4

我正在使用Python ES客户端,我想查询有关索引的统计信息。更确切地说,我正在寻找这个端点:

GET /_stats

有人知道如何使用文档中提到的IndicesClient类吗?

2
你正在寻找stats方法吗?你可以使用es.indices.stats(...),其中es是你的Elasticsearch对象。 - Sohaib Farooqi
1个回答

12

尝试:

from elasticsearch import Elasticsearch

es = Elasticsearch("localhost:9200")
es.indices.stats(index=<your_index_name>)

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接