Update aliases and delete indices atomically

  • POST /_aliases
Auth

Adds a data stream or index to an alias.

Query parameters

master_timeout string · default: 30s

Period to wait for a connection to the master node. If no response is received before the timeout expires, the request fails and returns an error.

timeout string · default: 30s

Period to wait for a response. If no response is received before the timeout expires, the request fails and returns an error.

Request body

actions object[]

Actions to perform.

add object

Adds a data stream or index to an alias. If the alias doesn’t exist, the add action creates it.

alias string

Alias for the action. Index alias names support date math.

aliases union string | string[]

Aliases for the action. Index alias names support date math.

filter {} Query

Query used to limit documents the alias can access.

index string

Data stream or index for the action. Supports wildcards (*).

indices union oneOf

Data streams or indices for the action. Supports wildcards (*).

One of: string[] or string
index_routing string

Value used to route indexing operations to a specific shard. If specified, this overwrites the routing value for indexing operations. Data stream aliases don’t support this parameter.

is_hidden boolean · default: false

If true, the alias is hidden.

is_write_index boolean

If true, sets the write index or data stream for the alias.

routing string

Value used to route indexing and search operations to a specific shard. Data stream aliases don’t support this parameter.

search_routing string

Value used to route search operations to a specific shard. If specified, this overwrites the routing value for search operations. Data stream aliases don’t support this parameter.

must_exist boolean · default: false

If true, the alias must exist to perform the action.

remove object

Removes a data stream or index from an alias.

alias string

Alias for the action. Index alias names support date math.

aliases union string | string[]

Aliases for the action. Index alias names support date math.

index string

Data stream or index for the action. Supports wildcards (*).

indices union oneOf

Data streams or indices for the action. Supports wildcards (*).

One of: string[] or string
must_exist boolean · default: false

If true, the alias must exist to perform the action.

remove_index object

Deletes an index. You cannot use this action on aliases or data streams.

index string

Data stream or index for the action. Supports wildcards (*).

indices union oneOf

Data streams or indices for the action. Supports wildcards (*).

One of: string[] or string
must_exist boolean · default: false

If true, the alias must exist to perform the action.

Response

application/json
acknowledged boolean required

For a successful response, this value is always true. On failure, an exception is returned instead.