Skip to content

Instantly share code, notes, and snippets.

@teodanciu
Created July 12, 2016 15:49
Show Gist options
  • Save teodanciu/65863572a7d2c19a77e26db30a6e7ab3 to your computer and use it in GitHub Desktop.
Save teodanciu/65863572a7d2c19a77e26db30a6e7ab3 to your computer and use it in GitHub Desktop.
# Get aliases
GET http://:esHost/_aliases
# {
# "filter": { "terms": { "postId": ["dGfbX_4XQ5aq34X_PY8OTA"] } }
# }
# Create the posts index
PUT http://:esHost/posts-0003
# Create an alias for the posts index
POST http://:esHost/_aliases
{
"actions": [
{ "remove": { "index": "posts-0002", "alias": "posts" } },
{ "add": { "index": "posts-0003", "alias": "posts" } }
]
}
# Re-index posts
POST http://:esHost/_reindex
{
"source": { "index": "posts-0001" },
"dest": { "index": "posts-0002" }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment