Skip to content

Instantly share code, notes, and snippets.

@dabit
Last active August 29, 2015 14:17
Show Gist options
  • Save dabit/cb383525e7a8e220d0b8 to your computer and use it in GitHub Desktop.
Save dabit/cb383525e7a8e220d0b8 to your computer and use it in GitHub Desktop.
Elasticsearch quick reindex post
curl -XPOST 'http://localhost:9200/_aliases' -d '
{
"actions" : [
{ "add" : { "index" : "articles-1", "alias" : "articles" } }
]
}'
curl -X PUT "http://localhost:9200/articles-2"
curl -X PUT "http://localhost:9200/articles-1"
elasticdump --input=http://localhost:9200/articles-1 \
--output=http://localhost:9200/articles-2 \
--type=data \
--limit=1000 \
--bulk=true \
--bulk-use-output-index-name
curl -XPOST 'http://localhost:9200/_aliases' -d '
{
"actions" : [
{ "remove" : { "index" : "articles-1", "alias" : "articles" } },
{ "add" : { "index" : "articles-2", "alias" : "articles" } }
]
}'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment