22
11

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

Elasticsearchのcurlを使ったindexの削除

Last updated at Posted at 2018-04-05

jqコマンドがない場合は、表示の見やすさだけなので「| jq」は省略して問題ない。
「?pretty=true」を付けることで返却値が整形されるようです。
コメントで教えていただきました。

# 存在確認
curl -XGET localhost:9200/index_name/_mapping?pretty=true

# 削除
curl -XDELETE localhost:9200/index_name?pretty=true

# 存在確認(消えていること)
curl -XGET localhost:9200/index_name/_mapping?pretty=true

削除時のレスポンス

  • 削除
{
  "acknowledged": true
}
  • 削除後の確認
{
  "error": "IndexMissingException[[index_name] missing]",
  "status": 404
}
22
11
2

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
22
11

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?