# Reindex - add new fields not working

**URL:** <https://discuss.elastic.co/t/reindex-add-new-fields-not-working/194271>\
**Category:** Elasticsearch\
**Created:** [August 7, 2019, 3:33pm UTC](https://discuss.elastic.co/t/reindex-add-new-fields-not-working/194271 "2019-08-07T15:33:51Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![brjisc](https://avatars.discourse-cdn.com/v4/letter/b/6bbea6/32.png) [@brjisc](https://discuss.elastic.co/u/brjisc)\
**Post date:** [August 7, 2019, 3:33pm UTC](https://discuss.elastic.co/t/reindex-add-new-fields-not-working/194271/1 "2019-08-07T15:33:51Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [September 4, 2019, 3:43pm UTC](https://discuss.elastic.co/t/reindex-add-new-fields-not-working/194271/2 "2019-09-04T15:43:03Z")

</div>

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