Query for all indices in a cluster


In Elasticsearch 6.x, there is a call to es.indices.get_alias to get all the indices in a given alias. Is there a method to get all indices that are not associated with any alias. My purpose is to clean up those indices that are not associated with any alias.

(Zachary Tong) #2

Not that I'm aware of. You can get a list of all the indices (Cat Indices, Get Index, etc), but I can't think of an API that returns only the indices that don't have an associated alias.

I think you'll have to get the list of indices, then the list of aliases and their associated indices, and intersect the two sets client-side.


Thanks, I can use curl to get the indices as you suggested. Does it have any way to get indices that match a certain pattern in Python?

curl -X GET "localhost:9200/1234*"


I found out that you can get all the indices that match a pattern as

(system) #5

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