I have read the documentation that says:
An alias can point to multiple indices, so we need to remove the alias from the old index at the same time as we add it to the new index. The change needs to be atomic, which means that we must use the _aliases endpoint:
say I have an index "stuff_v1", with an alias "stuff".
And also say that stuff_v1 has an incorrect type for a column in the mapping and I need to fix that.
I was under the impression that I could:
- update my mapping with the correct type.
- create a new index "stuff_v2" with the new mapping
- set the alias "stuff" on it so both "stuff_v1" and "stuff_v2" have the same alias
- scan & scroll stuff_v1 into stuff_v2 -- meanwhile because they both share the same alias, indexing a record will work and go into both indices.
... That's what I thought was how all this works...
However, when I tried to do this, I get:
ElasticsearchIllegalArgumentException[Alias [stuff_alias] has more than one indices associated with it [[stuff_v1, stuff_v2]], can't execute a single index op]
so................................... I guess I totally don't understand how this zero downtime stuff is really supposed to work.