Skip to content

Instantly share code, notes, and snippets.

@diegopacheco
Created August 10, 2016 21:36
Show Gist options
  • Star 18 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save diegopacheco/58fd31e442f04a44d49498ec785c1f27 to your computer and use it in GitHub Desktop.
Save diegopacheco/58fd31e442f04a44d49498ec785c1f27 to your computer and use it in GitHub Desktop.
How to Delete All Data in Elasticsearch?
curl -XDELETE localhost:9200/*
@mahemoff
Copy link

@knownasilya
Copy link

curl -XDELETE localhost:9200/_all worked for me

@keithbro
Copy link

keithbro commented Nov 1, 2017

@RevoluPowered
Copy link

RevoluPowered commented Apr 27, 2018

xpack users this will make your cluster inaccessible on kibana, at least it did on my end.

@mb2dev
Copy link

mb2dev commented Jun 1, 2018

@tosto92
Copy link

tosto92 commented Jul 3, 2018

what if my elasticsearch doesn't start because of the big amount of data? is there a way to purge everything without breaking it?

@Roy-Orbison
Copy link

@tosto92 if you can afford to wipe out the structure too, then

  1. stop elastic service
  2. rename data dir (append a ~) usually in /var/lib/elasticsearch
  3. start service
  4. recreate indices
  5. repopulate with data

If it goes bad, just revert the rename in the same manner.

@patelvp
Copy link

patelvp commented Sep 23, 2020

❤️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment