How can I delete all indices that don't have documents?

How can I delete all Elasticsearch that have no documents within? Also, is this safe ? I mean if an index has no documents then it's practically useless right?

Unless you have something using them, then yes you can delete them as they are just wasting resources.

Use the delete API endpoint -

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