We rebuild the same index regularly (multiple times per day) to keep our data up to date. This way we quickly generate a lot of old indices.
So we thought about removing them with a policy (ILM) which deletes old indices let's say 7 days after index creation.
This works fine but the only problem with it is that it could potentially delete the current (active) index. In a hypothetical scenario when the index rebuild would stop for 7 days it would delete the currently active index.
So my question is whether there is a way to keep the active index from being deleted. We have an alias on the current index. Is there a way to protect it from deletion and when switching to the new index we can switch the protection over to the newly created index?