Update aliases and delete indices atomically
- POST /_aliases
Applies one or more actions in a single request:
- Add a data stream or index to an alias.
- Remove a data stream or index from an alias.
- Delete an index in that same request, so the deletion and the alias changes are applied together.
For example, you can replace an index with an alias of the same name.
Every remove_index action in the request runs first, before any add or remove actions, no matter where it sits in the actions array.
Required authorization
- Index privileges manage
Request body
-
actionsobject[] -
Actions to perform.
-
addobject -
Adds a data stream or index to an alias. If the alias doesn’t exist, the
addaction creates it. -
filter{} Query -
Query used to limit documents the alias can access.
-
indexstring -
Data stream or index for the action. Supports wildcards (
*). Wildcard patterns that match both data streams and indices return an error. -
indicesunion oneOf -
Data streams or indices for the action. Supports wildcards (
*). Wildcard patterns that match both data streams and indices return an error. -
One of:
string[]orstring -
index_routingstring -
Value used to route indexing operations to a specific shard. If specified, this overwrites the
routingvalue for indexing operations. Data stream aliases don’t support this parameter. -
routingstring -
Value used to route indexing and search operations to a specific shard. Data stream aliases don’t support this parameter.