Last active
November 11, 2015 13:13
-
-
Save robertomiranda/2cc28ed84f6a18afd2c9 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Fetch all the "mapping" from elasticsearch using the enpoint | |
| # "/_mapping" and saved them on mapping.json file | |
| # curl http://localhost:9200/_mapping | |
| # parse the results fetched and saved into mapping.json and we iterate over | |
| # the parent index names and start to call the endpoint for delete them | |
| require "json" | |
| keys = JSON.parse(`curl http://localhost:9200/_mapping`).keys | |
| keys.each {|key| `curl -XDELETE http://localhost:9200/#{key}`} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment