Aliases
Learn how to create and manage index aliases with CBElasticsearch
cbElasticSearch offers the AliasBuilder
for assistance in adding and removing index aliases.
For creating an alias:
For removing an alias:
For bulk operations, use the cbElasticSearch client's applyAliases
method. These operations are performed in the same transaction (i.e. atomic), so it's safe to use for switching the alias from one index to another.
Retrieving Aliases
The client's getAliases
method allows you to retrieve a map containing information on aliases in use in the connected cluster.
The corresponding object will have two keys: aliases
and unassigned
. The former is a map of aliases with their corresponding index, the latter is an array of indexes which are unassigned to any alias.
Last updated