The _rollover API supports time-based or continuously growing data, such as application logs or car documents. It creates a successor index and continues access through an alias. section 6.8.3
Listing 6.45 Creating an alias for an existing index
POST _aliases #1
{
"actions": [ #2
{
"add": { #3
"index": "cars_2021-000001", #4
"alias": "latest_cars_a", #5
"is_write_index": true #6
}
}
]
}
Create an alias for the current index before rolling it over. The alias must have a writable backing index, marked with is_write_index: true. section 6.8.3
Roll over a car index
POST latest_cars_a/_rollover A successful response identifies the old and new indexes, such as latest_cars-000001 and latest_cars-000002. Index names need a positive numeric suffix; Elasticsearch increments it and pads it with zeros. The API also supports index or data stream aliases. section 6.8.3
