【问题标题】:TypeError: 'IndicesClient' object is not callableTypeError:“IndicesClient”对象不可调用
【发布时间】:2020-11-10 11:48:25
【问题描述】:

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

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

TypeError: 'IndicesClient' 对象不可调用

Documentation

谢谢。

【问题讨论】:

    标签: elasticsearch python-3.6 elasticsearch-dsl kibana-7 elasticsearch-indices


    【解决方案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'}]
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2018-12-25
      • 2021-04-15
      • 2011-10-01
      • 2017-09-09
      • 2016-07-23
      • 2015-03-07
      • 2013-11-14
      相关资源
      最近更新 更多