LoginSignup
1
0

More than 5 years have passed since last update.

Elasticsearch で indices を操作する方法(PowerShell版)

Posted at

Elasticsearch で indices を操作する

PowerShellで使えるElasticsearchのインデックス操作コマンドのまとめ

indicesを確認(ブラウザ)

下記URLでindicesの一覧を表示できます。

http://localhost:9200/_cat/indices?v

indices をクローズするには

下記コマンドでクローズできます。

> Invoke-RestMethod -Uri "http://localhost:9200/<indices名>/_close" -Method POST

ついでに、indices名は * で ワイルドカード指定もできます。

> Invoke-RestMethod -Uri "http://localhost:9200/<indices名途中まで>*/_close" -Method POST

indices をオープンするには

下記コマンドでオープンできます。

> Invoke-RestMethod -Uri "http://localhost:9200/<indices名>/_open" -Method POST

ついでに、indices名は * で ワイルドカード指定もできます。

> Invoke-RestMethod -Uri "http://localhost:9200/<indices名途中まで>*/_open" -Method POST

indices を削除するには

下記コマンドで削除できます。

> Invoke-RestMethod -Uri "http://localhost:9200/<indices名>" -Method DELETE

下記のコマンドで全削除できます。

> Invoke-RestMethod -Uri "http://localhost:9200/_all" -Method DELETE

参照

参考にさせていただいたQiitaの記事です。
curlコマンドが使える場合はこちら
Elasticsearch で indices をさくっとクローズしたりする方法

1
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
1
0