Why can't we rename indices?

Ok, so, I ran into a situation where I really needed to be able to rename my index. Somehow it was created before my template was applied and as a result it was a normal index instead of an alias. Which turned into a giant 300+GB index.

From previous experience I knew that Elasticsearch does not support actual renaming, so I figured out a partial work around. Only partial because I will (or have already) end up losing data due to lack of space. Cloning failed, and I can only reindex some of the data before I (will run) ran out of room.

This whole situation would be far simpler to resolve if I could just rename the index as the target of the alias, make sure the alias/rollover/template is working, and then be done. I'd let ILM go in and roll over the index and deal with all the data stuff it needs to deal with.

I did some searching to see if anyone had addressed my question already, but so far all I've found are posts about "use clone/reindex/aliases" instead. Not anything about WHY.

So, why can't we rename indices?

Thanks.

You can use an alias which is like a renaming.

If renaming would be possible it would not take into account any modification though.

Er, yes, I know. I'm not asking "how", or for help. I'm asking "why?" this works the way it works.

As in the reasoning (technical and not) behind why you can't rename an index.

Er, I'll just post this to give this topic another month, just in case someone wants to answer.

The index to document relationship is immutable and, therefore, can not be renamed.

The index can not be renamed because the index to document relationship is immutable.

This is the way....

Maybe someone else will give you a better response but this goes back to the earliest / fundamental concepts in elasticssearch and lucene...

In addition to using an alias you can also clone the index into an index with the new name you desire and then delete the original one.

This is actually the kind of answer I was looking for. Thanks!

I was going to ask why it's immutable, but after thinking about it, it makes sense that the relationship is immutable just like an sql table row is immutable to the table it is in.

I think the reason I thought it wasn't like that is because the data storage of the indices doesn't use the index name, just all the random folder names. So I was thinking of the index name as basically an alias to some randomized real name.

Er, clone doesn't work when you don't have enough disk space for it. Reindex only sorta worked because i didn't end up saving all the data. I let a lot of it just get deleted.