# Different field type on couple shards

**URL:** <https://discuss.elastic.co/t/different-field-type-on-couple-shards/272019>\
**Category:** Elasticsearch\
**Created:** [May 3, 2021, 7:04pm UTC](https://discuss.elastic.co/t/different-field-type-on-couple-shards/272019 "2021-05-03T19:04:10Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![rh\_es](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rh_es/32/88154_2.png) [@rh\_es](https://discuss.elastic.co/u/rh_es)\
**Post date:** [May 3, 2021, 7:04pm UTC](https://discuss.elastic.co/t/different-field-type-on-couple-shards/272019/1 "2021-05-03T19:04:11Z")

</div>

Hello. Somehow the type of one field in two shards is different of type at entire index and rest of the shards. As result some queries that rely on the field having specific type (number) are impacted. I know that it is impossible to change field type of the index/shard. What would be the right way of recreating the shard with fix field types and how to avoid this kind of problems in future?

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [May 4, 2021, 12:09am UTC](https://discuss.elastic.co/t/different-field-type-on-couple-shards/272019/2 "2021-05-04T00:09:42Z")

</div>

Make sure you have a [mapping template](https://www.elastic.co/guide/en/elasticsearch/reference/7.12/index-templates.html) setup to apply to future indices, then use reindex on the incorrect data.

---

<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 1, 2021, 12:10am UTC](https://discuss.elastic.co/t/different-field-type-on-couple-shards/272019/3 "2021-06-01T00:10:36Z")

</div>

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