Skip to content

Instantly share code, notes, and snippets.

@hughdbrown
Last active March 18, 2019 16:51
Show Gist options
  • Save hughdbrown/18d3a97144cca9bcfb7414dde41134bd to your computer and use it in GitHub Desktop.
Save hughdbrown/18d3a97144cca9bcfb7414dde41134bd to your computer and use it in GitHub Desktop.
from elasticsearch import Elasticsearch
from elasticsearch_dsl import Search, Index
client = Elasticsearch()
idx = client.indices.stats()
for key in idx['indices'].keys():
if key.startswith('unittest'):
print(key)
Index(key, using=client).delete()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment