Get index by alias with python api

how to get actual index name by index alias name with elasticsearch-py or elasticsearch-dsl-py
the version of es is 6.2.4

for your help! thank you ahead!

up,up

Read this and specifically the "Also be patient" part.

It's fine to answer on your own thread after 2 or 3 days (not including weekends) if you don't have an answer.

It's easy as that:

if es.indices.exists_alias("test-alias"):    
     print(list(es.indices.get("test-alias").keys())[0])
1 Like

ok,thanks

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.