Hello I want to change an index property which is object (default) to nested type and keep the data. The process I'm following is creating a new index with the new mappings then use the reindex API.
The problem comes when I use the reindex API to reindex from Old_index to the New_index I'm getting an obvious error.
OLD Index (cities is a list)
{
"settings":{
"number_of_shards":1,
"number_of_replicas":1
},
"mapping":{
"properties":{
"cities":{
"type":"object",
"properties":{
"name":{
"type":"keyword"
}
}
}
}
}
}
New INDEX (cities is a list but now nested with new properties on its name)
{
"settings":{
"number_of_shards":1,
"number_of_replicas":1
},
"mapping":{
"properties":{
"cities":{
"type":"nested",
"properties":{
"id":{
"type":"keyword"
},
"name":{
"type":"object",
"properties":{
"english":{
"type":"text"
},
"dutch":{
"type":"text"
},
"raw":{
"type":"keyword"
}
}
}
}
}
}
}
}
The new index will use custom analyzers (which I ignored in the example) but when the reindex api tries to index the data from old index to new index in documents where cities is not empty. Following error appears as a failure:
object mapping for [cities.name] tried to parse field articleTitle as object, but found a concrete value
Is there a way to make this index change and reindex all data?