Using ES HTTP API


It’s software development tips post!

Clearing your ES indexes

Super simple example, how we can clear all elastic search indexes via HTTP API.

require "json"
keys = JSON.parse(`curl http://localhost:9200/_mapping`).keys
keys.each {|key| `curl -XDELETE http://localhost:9200/#{key}`}