1

es_res = es.indices(index=index, bytes='b',format='json')

调用索引 api 时出现以下错误

TypeError:“IndicesClient”对象不可调用

文档

谢谢你。

4

1 回答 1

1

要获取有关索引的信息,

In [127]: from elasticsearch import Elasticsearch

In [128]: params = {"bytes":"b","format":"json"}

In [129]: es = Elasticsearch()

In [130]: es.cat.indices("blogs", params=params)
Out[130]:
[{'health': 'yellow',
  'status': 'open',
  'index': 'blogs',
  'uuid': 'vqkQn3UxS1qGaM3OfLEUSg',
  'pri': '3',
  'rep': '1',
  'docs.count': '0',
  'docs.deleted': '0',
  'store.size': '849',
  'pri.store.size': '849'}]
于 2020-07-21T06:56:25.850 回答