A production index can change roles over time: it may accept searches and writes while hot, become read-only when warm or cold, and eventually be deleted. Each index lifecycle phase is a stage where configured actions run when their conditions are satisfied. section 6.10 section 6.9
An ILM policy defines the phases and their actions. A phase can wait for a minimum age before acting, while the next phase begins after its configured actions complete. Policies can use conditions such as index size, document count, or elapsed time. section 6.9.2 section 6.9
Listing 6.48 Creating a policy with hot and delete phases
PUT _ilm/policy/hot_delete_policy #1
{
"policy": { #2
"phases": {
"hot": { #3
"min_age": "1d", #4
"actions": { #5
"set_priority": { #6
"priority": 250
}
}
},
"delete": { #7
"actions": {
"delete" : { }
}
}
}
}
}
This policy keeps an index in the hot phase for one day, sets its recovery priority, and then deletes it immediately after the hot phase finishes. section 6.9.2
Attach a lifecycle to an index
Create the index with index.lifecycle.name pointing to hot_delete_policy. The association causes the index to enter the hot phase and follow the policy’s phase transitions. section 6.9.2
