0
0

pythonでelasticsearchのindexの削除

Posted at
# %%
from elasticsearch import Elasticsearch

username = 'admin'
passwrod = '<INPUT YOUR ADMIN PASSWORD>'
host = 'https://%s:%s@<INPUT YOUR HOSTNAME>:<INPUT YOUR PORT NUMBER>' % (username, passwrod)
print(host)
client = Elasticsearch(hosts=host, ca_certs='INPUT YOUR CARTIFICATE FILE PATH')
# %%
client.cat.indices(index='*', h='index').splitlines()
# %%
client.indices.delete(index='test2')
# %%
client.close()

Elasticsearch、すごい使いやすいかも…

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0