An alias is an alternate name for one Elasticsearch index or a group of indexes. Use the alias in requests instead of naming each backing index, so a search can span rolling indexes through one stable name. section 3.2.3 section 6.2.5
Aliases are an index configuration, alongside settings and mappings. Create one while creating an index with an aliases object, or attach one later through the _alias endpoint. section 6.0 section 6.2.5
Create and use a single-index alias
Create an alias when creating the index: PUT cars_for_aliases { "aliases": { "my_new_cars_alias": {} } } Or add an alias to an existing index: PUT cars_for_aliases/_alias/my_cars_alias The alias becomes a second name for cars_for_aliases, so indexing and search operations can be redirected to my_cars_alias. section 6.2.5
Aliases support two common operational patterns:
- Search across several indexes through one alias, avoiding requests that explicitly list every rolling or dated index. section 3.2.3 section 6.2.5
- Move an application from an old reindexed index to a replacement index without downtime by removing and adding the same alias in one _aliases request. section 4.3.3 section 6.2.5
- Prepare rollover by assigning an alias to the current index and marking a backing index as the write index before calling _rollover. section 6.8.3
When one alias points to multiple indexes, ensure at least one backing index has is_write_index set to true. Wildcards can also select the indexes attached to an alias. section 6.2.5
Listing 6.19 Performing multiple aliasing operations
POST _aliases #1 { "actions": [ #2 { "remove": { #3 "index": "vintage_cars", "alias": "vintage_cars_alias" } }, { "add": { #4 "index": "vintage_cars_new", "alias": "vintage_cars_alias" } } ] } #1 Uses the _aliases API to execute multiple actions #2 Lists the individual actions #3 Removes the alias that points to an old index #4 Adds an alias that points to a new index
The paired remove and add actions show how one alias can switch from an old index to a replacement index as a single migration operation. section 6.2.5





