# Mapper \[Id\] cannot be changed from type \[text\] to \[integer\]

**URL:** <https://discuss.elastic.co/t/mapper-id-cannot-be-changed-from-type-text-to-integer/99211>\
**Category:** Elasticsearch\
**Created:** [September 3, 2017, 7:21am UTC](https://discuss.elastic.co/t/mapper-id-cannot-be-changed-from-type-text-to-integer/99211 "2017-09-03T07:21:51Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![aslamy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/aslamy/32/18254_2.png) [@aslamy](https://discuss.elastic.co/u/aslamy)\
**Post date:** [September 3, 2017, 7:21am UTC](https://discuss.elastic.co/t/mapper-id-cannot-be-changed-from-type-text-to-integer/99211/1 "2017-09-03T07:21:51Z")

</div>

Hi !  
I have deleted my index and want to create a new index for (new map). But I get this error message:

{  
"error": {  
"root\_cause": [  
{  
"type": "illegal\_argument\_exception",  
"reason": "mapper [Id] cannot be changed from type [text] to [integer]"  
}  
],  
"type": "illegal\_argument\_exception",  
"reason": "mapper [Id] cannot be changed from type [text] to [integer]"  
},  
"status": 400  
}

---

<div class="post-metadata">

**Author:** ![Mark\_Harwood](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mark_harwood/32/10538_2.png) [@Mark\_Harwood](https://discuss.elastic.co/u/Mark_Harwood)\
**Post date:** [September 3, 2017, 7:32am UTC](https://discuss.elastic.co/t/mapper-id-cannot-be-changed-from-type-text-to-integer/99211/2 "2017-09-03T07:32:17Z")

</div>

The index can't have been deleted.  
Do you have a process somewhere sending docs? That may have spawned a new index after you deleted the old one.

---

<div class="post-metadata">

**Author:** ![aslamy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/aslamy/32/18254_2.png) [@aslamy](https://discuss.elastic.co/u/aslamy)\
**Post date:** [September 3, 2017, 7:48am UTC](https://discuss.elastic.co/t/mapper-id-cannot-be-changed-from-type-text-to-integer/99211/3 "2017-09-03T07:48:08Z")

</div>

Thank you .  
I find the problem.

"Fields need to be consistent across types. For instance if two fields have the same name in different types of the same index, they need to be of the same field type (string, date, etc.) and have the same configuration."

---

<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:** [October 1, 2017, 7:48am UTC](https://discuss.elastic.co/t/mapper-id-cannot-be-changed-from-type-text-to-integer/99211/4 "2017-10-01T07:48:12Z")

</div>

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