# Reindexing Error while changing the type for fields

**URL:** <https://discuss.elastic.co/t/reindexing-error-while-changing-the-type-for-fields/211848>\
**Category:** Elasticsearch\
**Created:** [December 13, 2019, 9:04pm UTC](https://discuss.elastic.co/t/reindexing-error-while-changing-the-type-for-fields/211848 "2019-12-13T21:04:52Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![kumar6](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kumar6/32/55327_2.png) [@kumar6](https://discuss.elastic.co/u/kumar6)\
**Post date:** [December 13, 2019, 9:04pm UTC](https://discuss.elastic.co/t/reindexing-error-while-changing-the-type-for-fields/211848/1 "2019-12-13T21:04:53Z")

</div>

I changed the type to integer from string for some of the fields in td-agent(similar to logstash).  
I started seeing Mapping conflict in Kibana.

**Error in Kibana:**

2 fields are defined as several types (string, integer, etc) across the indices that match this pattern. You may still be able to use these conflict fields in parts of Kibana, but they will be unavailable for functions that require Kibana to know their type. Correcting this issue will require reindexing your data.

I tried below steps as suggested in the forums.

**1.Created Index with the following.**

PUT /2019-11-13-01-05-reindex?pretty  
{  
"settings": {  
"number\_of\_shards": 1,  
"number\_of\_replicas": 1  
},  
"mappings": {  
"\_doc": {  
"properties": {  
"gid": {  
"type": "integer"  
},  
"pid": {  
"type": "integer"  
}  
}  
}  
}  
}

**2.Reindex using the existing index.**

POST /\_reindex?pretty  
{  
"source": {  
"index": "2019-11-13-01-05"  
},  
"dest": {  
"index": "2019-11-13-01-05-reindex"  
, "version\_type": "external"  
}  
}

**Seeing Error:**

{  
"took": 4450,  
"timed\_out": false,  
"total": 25094,  
"updated": 0,  
"created": 0,  
"deleted": 0,  
"batches": 1,  
"version\_conflicts": 0,  
"noops": 0,  
"retries": {  
"bulk": 0,  
"search": 0  
},  
"throttled\_millis": 0,  
"requests\_per\_second": -1,  
"throttled\_until\_millis": 0,  
"failures": [  
{  
"index": "2019-11-13-01-05-reindex",  
"type": "log",  
"id": "49596857962723131814983270744084022071986919347295617026.0",  
"cause": {  
"type": "illegal\_argument\_exception",  
"reason": "Rejecting mapping update to [2019-11-13-01-05-reindex] as the final mapping would have more than 1 type: [log, \_doc]"  
},  
"status": 400  
},  
{  
"index": "2019-11-13-01-05-reindex",  
"type": "log",  
"id": "49596857962723131814983270744087648849445763234819735554.0",  
"cause": {  
"type": "illegal\_argument\_exception",  
"reason": "Rejecting mapping update to [2019-11-13-01-05-reindex] as the final mapping would have more than 1 type: [log, \_doc]"  
},  
"status": 400  
},

Can someone please let me know the solution.

---

<div class="post-metadata">

**Author:** ![spinscale](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/spinscale/32/25011_2.png) [@spinscale](https://discuss.elastic.co/u/spinscale)\
**Post date:** [December 16, 2019, 9:29am UTC](https://discuss.elastic.co/t/reindexing-error-while-changing-the-type-for-fields/211848/2 "2019-12-16T09:29:25Z")

</div>

the interesting part if this

> Rejecting mapping update to [2019-11-13-01-05-reindex] as the final mapping would have more than 1 type: [log, \_doc]

somehow you are trying to create two types in that index. Is it possible, that another index template is trying to create the `log` type on index creation?

---

<div class="post-metadata">

**Author:** ![kumar6](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kumar6/32/55327_2.png) [@kumar6](https://discuss.elastic.co/u/kumar6)\
**Post date:** [December 18, 2019, 7:20pm UTC](https://discuss.elastic.co/t/reindexing-error-while-changing-the-type-for-fields/211848/3 "2019-12-18T19:20:14Z")

</div>

I was able to resolve this after updating mapping name.

---

<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:** [January 15, 2020, 7:20pm UTC](https://discuss.elastic.co/t/reindexing-error-while-changing-the-type-for-fields/211848/4 "2020-01-15T19:20:24Z")

</div>

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