Reindex - add new fields not working

Reindexing data from one index to a new index with a new mappings seems to be losing fields.
My old index contains a document with the fields:

"service": {
"jid": "J00008",
"action": {
"species": "NEWS",
"genus": "STATIC PAGE"
},
"name": "JUSP"
}

The old index had the following mapping for the service field structure:

"service":{
"properties":{
"action":{
"properties":{
"genus":{
"type":"text",
"analyzer":"standard",
"fields":{
"raw":{
"type":"text",
"index":"false",
"store":true
}
}
},
"species":{
"type":"text",
"analyzer":"standard",
"fields":{
"raw":{
"type":"text",
"index":"false",
"store":true
}
}
}
}
},
"jid":{
"type":"text",
"analyzer":"standard",
"fields":{
"raw":{
"type":"text",
"index":"false",
"store":true
}
}
},
"name":{
"type":"text",
"analyzer":"standard",
"fields":{
"raw":{
"type":"text",
"index":"false",
"store":true
}
}
}
}
}

The new index has the following mapping for the service fields structure:

"service":{
"properties":{
"action":{
"properties":{
"genus":{
"type":"text",
"analyzer":"standard",
"fields":{
"raw":{
"type":"text",
"index":"false",
"store":true
},
"kw": {
"type": "keyword",
"index":"false",
"store":true
}
}
},
"species":{
"type":"text",
"analyzer":"standard",
"fields":{
"raw":{
"type":"text",
"index":"false",
"store":true
},
"kw": {
"type": "keyword",
"index":"false",
"store":true
}
}
}
}
},
"jid":{
"type":"text",
"analyzer":"standard",
"fields":{
"raw":{
"type":"text",
"index":"false",
"store":true
}
}
},
"name":{
"type":"text",
"analyzer":"standard",
"fields":{
"raw":{
"type":"text",
"index":"false",
"store":true
}
}
}
}
}

When I use the reindex API the service field content changes from:

"service": {
"jid": "J00008",
"action": {
"species": "NEWS",
"genus": "STATIC PAGE"
},
"name": "JUSP"
}

to

"service": {
"jid": "J00008",
"name": "JUSP"
}

So instead of adding a new sub-field "kw" to the genus and species sub-fields the "action" field structure is missing.

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.