Hi,
I'm trying to migrate an Elasticsearch index from 6.8 to 7.10 using the _reindex
route API.
Unfortunately during the index migration I get the error Cannot write to a field alias [gl2_message_id].
The mapping, copied from source index to destination index, is the following:
"properties": {
"gl2_message_id": {
"type": "alias",
"path": "id"
},
"id": {
"type": "keyword"
},
[...]
FYI, these index and data have been generated by Graylog
For what I understand, the _reindex
process tries to write to gl2_message_id
which is forbidden as it is an alias.
What I don't understand is how is it possible that in the source index a concrete value exists in gl2_message_id
.
So I tried to recreate this situation to understand it. But I failed to reproduce it:
-
First try on a new index, I create a document
{ "field1": true, "field1Alias": true }
.
Then I update mapping and declare the fieldfield1Alias
as{ "type": "alias", "path": "field1" }
.It fails (as it should) because
field1Alias
exists yet. -
Second try on a new index, I create a document
{ "field1": true }
.
Then I update mapping and declare the fieldfield1Alias
as{ "type": "alias", "path": "field1" }
.
Finally I try to index a document{ "field1Alias": true }
.It fails (as it should) because
field1Alias
is an alias and can't received concrete data.
I have 2 questions:
- How is it possible that I get data returned from field
gl2_message_id
during_reindex
while it's an alias? - How can I reindex these data?
I tried a lot of things, read the documentations multiple time but I'm stuck right now and I asking myself if there is a bug which allowed to put data to gl2_message_id
or a bug in _reindex
.
Thanks,
Adrien