How to get a list of all indexes in python-elasticsearch

后端 未结 7 1883
北海茫月
北海茫月 2021-02-06 20:32

How would I get a list of the names of an index in Python? Here is what I have so far:

>>> es=e.es
>>> es


        
7条回答
  •  误落风尘
    2021-02-06 21:16

    Here is one way to do it with the get_alias() method:

    >>> indices=es.indices.get_alias().keys()
    >>> sorted(indices)
    [u'avails', u'hey', u'kibana-int']
    

提交回复
热议问题