Asquera/elasticsearch-rake-tasks — pull request #7 by justahero (2014-02-13 17:48:05+00:00)
Title: Rake tasks added to enable update index with an alias

Two rake tasks were added to create new index and switch to it with setting an alias.

The first rake task `es:template:create` creates a new index and uses the possibly modified template. Most often this new index will have some kind of version number or versioning scheme, e.g. `users-0.1`. The second rake task `es:template:alias` can be used to switch to a different index without downtime, useful when applications use index `users`. It removes previously set aliases and points the new alias to the given index.

To update index `users-0.1` to `users-0.2` with a given template named `users`.

```
rake es:users:create[http://localhost:9200,users-0.2]
rake es:reindex[http://localhost:9200,users-0.1,users-0.2]
rake es:users:alias[http://localhost:9200,users-0.2]
```

After all is done index `users-0.1` can be safely deleted.