-
Notifications
You must be signed in to change notification settings - Fork 25.2k
Reindex automatic type conversion failure #38707
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Pinging @elastic/es-analytics-geo |
Pinging @elastic/es-distributed |
By the way this issue applies also for |
@synFK , thanks for your interest in elasticsearch. I have tried to reproduce this, but have not been successful in doing so. The type of a field generally cannot be modified once the mapping has been established so this should not be possible. It could be that the behaviour will not manifest itself except under specific conditions. I would like to get a little closer to the actual steps you took. My best guess at this time is that the_index-000001 was created before the template or at least that something prevented the template from being applied. The steps I did are given below (notice that these instructions will permanently delete the indices used in the example and that I used that names you supplied so be careful where you run this). Notice that I did a reindex from localhost for simplicity (I find it very unlikely to be something inflicted by the remote source).
Afterwards, the mapping was defined like this, ie. type long as expected:
|
@synFK given that we have not heard back from you on this, I will close this issue. Please reopen with clarification if you think there is still something to improve here. |
Hi @henningandersen, |
@synFK thanks for clarifying. This is the way it works, also if you simply put a document with a string for a long field:
gives:
whereas:
results in:
I suspect that the auto-conversion with painless happens in the script, not during reindex. |
Elasticsearch version: 6.6.0
Plugins installed: []
JVM version: 1.8.0_191
OS version: Linux 4.4.0-116-generic #140-Ubuntu SMP x86_64 GNU/Linux
Description of the problem including expected versus actual behavior:
When using the Reindex API and an explicit mapping on the destination index the automatic type conversion fails.
(Remote) Source cluster runs Elasticsearch 2.4.5. Destination is 6.6.0. While the source index has a field named "result.user.id" of type
string
(analyzed) with a subfield "raw" of typestring
(not_analyzed), the destination index has a mapping with typelong
for this field. It also has the optiondynamic
set tostrict
. After reindexing a set of documents, the type of this field in the destination index isstring
while the mapping explicitly states a long. No exceptions occured while reindexing.For testing purposes I add another field of type
long
to the destination index mapping called "id2" which I set to a constant string value "12345" with the aid of a little painless script. This string value is successfully auto converted to 12345 during reindexing.Steps to reproduce:
curl -X PUT <dest_host>/the_index-000001 -H "Content-Type: application/json"
curl -X POST <dest_host>/_reindex -H "Content-Type: application/json" -d "$reindex_body"
Logs (not relevant):
The text was updated successfully, but these errors were encountered: