Ruby script to copy ElasticSearch index (reindex).
Ruby
Pull request Compare This branch is 4 commits ahead, 17 commits behind geronime:master.
Latest commit 273f14d Oct 7, 2015 @pgaertig Merge pull request #4 from ketlane/status-recovery
Use _recovery endpoint for status check
Permalink
Failed to load latest commit information.
.gitignore
Gemfile
LICENSE Initial commit. Jun 13, 2012
README.markdown
es-reindex.rb

README.markdown

es-reindex - simple ruby script for copying ElasticSearch index

Simple ruby script to copy and reindex ElasticSearch index, copying index settings and mapping(s).

Progress and time estimation is displayed during the scrolling process.

Requirements

Ruby 1.8.6 or newer is required, use rvm for convenience.

Following gems are required via Gemfile:

You can install the requirements locally via bundler:

$ bundle install --path=.bundle

Usage

Refer to script's help:

$ ./es-reindex.rb -h

Script to copy particular ES index including its (re)creation w/options set
and mapping copied.

Usage:

  ./es-reindex.rb [-r] [-f <frame>] [source_url/]<index> [destination_url/]<index>

    - -r - remove the index in the new location first
    - -f - specify frame size to be obtained with one fetch during scrolling
    - -u - update existing documents (default: only create non-existing)
    - optional source/destination urls default to http://127.0.0.1:9200

Changelog

  • 0.0.4: Force create only, update is optional (@pgaertig)
  • 0.0.3: Yajl -> Oj
  • 0.0.2: repated document count comparison
  • 0.0.1: first revision

License

es-reindex is copyright (c)2012 Jiri Nemecek, and released under the terms of the MIT license. See the LICENSE file for the gory details.