python 对elstaticsearch数据查询所有数据量
可以使用elasticsearch-py包中的count方法查询所有数据量,示例代码如下:
from elasticsearch import Elasticsearch
es = Elasticsearch()
res = es.count(index="your_index_name")
print(res['count'])
其中,your_index_name为需要查询的索引名称。执行以上代码后,会返回该索引的所有数据量。
原文地址: https://www.cveoy.top/t/topic/huuw 著作权归作者所有。请勿转载和采集!