elasticsearch v0.1.1 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
store
andsources
. - Alias the
alias
toalias-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.