TypeError: 'IndicesClient' object is not callable

723 Views Asked by At

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

getting following error while calling indices api

TypeError: 'IndicesClient' object is not callable

Documentation

Thank you.

1

There are 1 best solutions below

0
On BEST ANSWER

To get information about an index,

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'}]