# Disable mapping for all fields except one index field

**URL:** <https://discuss.elastic.co/t/disable-mapping-for-all-fields-except-one-index-field/184855>\
**Category:** Elasticsearch\
**Created:** [June 8, 2019, 10:21pm UTC](https://discuss.elastic.co/t/disable-mapping-for-all-fields-except-one-index-field/184855 "2019-06-08T22:21:50Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![episodeyang](https://avatars.discourse-cdn.com/v4/letter/e/d6d6ee/32.png) [@episodeyang](https://discuss.elastic.co/u/episodeyang)\
**Post date:** [June 8, 2019, 10:21pm UTC](https://discuss.elastic.co/t/disable-mapping-for-all-fields-except-one-index-field/184855/1 "2019-06-08T22:21:51Z")

</div>

I want to index documents where same field can have different date types (current model is disappointingly low level...)

To this end, I want to add an `index` field to my document, and disable mapping for every other field except this index field.

Is there a way to configure in the `mappings` to do this? there is a question from earlier that is closed without getting an answer, which is very disappointing.

---

<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:** [June 9, 2019, 3:19am UTC](https://discuss.elastic.co/t/disable-mapping-for-all-fields-except-one-index-field/184855/2 "2019-06-09T03:19:30Z")

</div>

I think you can define a dynamic template which tells elasticsearch to ignore all fields and within the same mapping define a field which is indexed.

---

<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:** [July 7, 2019, 3:19am UTC](https://discuss.elastic.co/t/disable-mapping-for-all-fields-except-one-index-field/184855/3 "2019-07-07T03:19:35Z")

</div>

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