LoginSignup
9
10

More than 5 years have passed since last update.

よく使うElasticSearchのクエリ(elasticdump)

Last updated at Posted at 2017-10-28

ElasticSearchは、マニュアル(英語)がしっかりしてるので、そっちを参考にしてください。
マニュアル(本家):https://www.elastic.co/guide/en/elasticsearch/reference/current/index.html

環境

  • CentOS 7.1
  • ElasticSearch 5.6.2
    ※ElasticSearch 6.xでは、curlに「 -H 'Content-Type: application/json'」を付ける必要があります。
  • elasticdump 3.3.1
    ※2017.12.21現在、elasticdumpがElasticSearch 6.xに対応していません。
     ただ「 --headers='{"Content-Type": "application/json"}'」を付けることで一部の機能は使えます。

    ※2018.08.31現在、elasticdump 3.3.19では、ElasticSearch 6.xに対応されました。

目次

elasticdump(インポート/エクスポート)

elasticdumpを使うためには、別途elasticdumpをインストールする必要がある

■ インデックスをjsonファイルにエクスポートする

コマンド
elasticdump --input=http://localhost:9200/hoge_index --output=hoge_index.json

■ jsonファイルをインポートする

コマンド
elasticdump --input=hoge_index.json --output=http://localhost:9200/hoge_index

参考

9
10
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
9
10