elasticsearch v0.1.0 mix elasticsearch.build View Source
Builds Elasticsearch indexes using a zero-downtime, hot-swap technique.
- Build an index for the given
alias, with a timestamp:alias-12323123 - Bulk upload data to that index using
storeandsources. - Alias the
aliastoalias-12323123. - Remove old indexes beginning with
alias. - Refresh
alias-12323123.
For a functional version of this approach, see
Elasticsearch.Index.hot_swap/4.
Example
$ mix elasticsearch.build posts [index2] [index3]
To build an index only if it does not exist, use the --existing option:
$ mix elasticsearch.build posts --existing
Index posts already exists.