Hi,
I am writing a python script to reindex our files with new mappings on elastic 1.5.2 (before upgrade to 2.3). one of the changes was mappings of title:
"title":{"type":"string"}
that was changed to new mappings:
"title": {
"type": "string",
"fields": {
"english": {
"type": "string",
"analyzer": "buzzilla_english"
},
"arabic": {
"type": "string",
"analyzer": "buzzilla_arabic"
}
}
}
I tried to copy each doc and change it to the new mapping as follow:
old_doc = hit['_source']
new_doc = old_doc
title = new_doc['title']
language="english" //for the example
new_doc['title'] = {language:title }
When running it it trying to "put" the new file, I get:
{"error":"MapperParsingException[failed to parse [title]]; nested: ElasticsearchIllegalArgumentException[unknown property [english]]; ","status":400}
I also tried:
new_doc['title'] = {}
new_doc['title']['fields'] = {language:title }
But it also failed:
{"error":"MapperParsingException[failed to parse [parent_title]]; nested: ElasticsearchIllegalArgumentException[unknown property [fields]]; ","status":400}
What is the correct way to do it please?