# Insert new field in a existing index

**URL:** <https://discuss.elastic.co/t/insert-new-field-in-a-existing-index/182192>\
**Category:** Elasticsearch\
**Created:** [May 22, 2019, 9:53am UTC](https://discuss.elastic.co/t/insert-new-field-in-a-existing-index/182192 "2019-05-22T09:53:49Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jesus\_Rodrigo](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jesus_rodrigo/32/43168_2.png) [@Jesus\_Rodrigo](https://discuss.elastic.co/u/Jesus_Rodrigo)\
**Post date:** [May 22, 2019, 9:53am UTC](https://discuss.elastic.co/t/insert-new-field-in-a-existing-index/182192/1 "2019-05-22T09:53:49Z")

</div>

Hi,

I want insert a new field in a existing index, this index have a lot of logs and I don't delete it.

I try with this:

PUT myIndex/\_mapping  
{  
"properties" : {  
"newField" : {  
"type" : "string"  
}  
}  
}

But the response is the following:

{  
"error": {  
"root\_cause": [  
{  
"type": "action\_request\_validation\_exception",  
"reason": "Validation Failed: 1: mapping type is missing;"  
}  
],  
"type": "action\_request\_validation\_exception",  
"reason": "Validation Failed: 1: mapping type is missing;"  
},  
"status": 400  
}

How could I do it without deleting the index?

Thank you!

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [May 22, 2019, 2:05pm UTC](https://discuss.elastic.co/t/insert-new-field-in-a-existing-index/182192/2 "2019-05-22T14:05:32Z")

</div>

I suspect you are using a version prior to 7.x, right?  
Which one is that?

What is the output of:

```auto
GET /

```

---

<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:** [June 19, 2019, 2:05pm UTC](https://discuss.elastic.co/t/insert-new-field-in-a-existing-index/182192/3 "2019-06-19T14:05:32Z")

</div>

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