# Disable indexing for all fields by default

**URL:** <https://discuss.elastic.co/t/disable-indexing-for-all-fields-by-default/169342>\
**Category:** Elasticsearch\
**Created:** [February 21, 2019, 7:14am UTC](https://discuss.elastic.co/t/disable-indexing-for-all-fields-by-default/169342 "2019-02-21T07:14:49Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Praneet\_Khandelwal](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/praneet_khandelwal/32/40565_2.png) [@Praneet\_Khandelwal](https://discuss.elastic.co/u/Praneet_Khandelwal)\
**Post date:** [February 21, 2019, 7:14am UTC](https://discuss.elastic.co/t/disable-indexing-for-all-fields-by-default/169342/1 "2019-02-21T07:14:49Z")

</div>

I have a mapping for the index I want to create in ElasticSearch. I want to disable indexing for all the fields in the mapping and enable only for a few fields which I can specify. Any suggestions for which mapping parameters or settings would suffice for this?

---

<div class="post-metadata">

**Author:** ![jpountz](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jpountz/32/45836_2.png) [@jpountz](https://discuss.elastic.co/u/jpountz)\
**Post date:** [February 22, 2019, 9:36am UTC](https://discuss.elastic.co/t/disable-indexing-for-all-fields-by-default/169342/2 "2019-02-22T09:36:56Z")

</div>

See [https://www.elastic.co/guide/en/elasticsearch/reference/current/dynamic.html](https://www.elastic.co/guide/en/elasticsearch/reference/current/dynamic.html). You can set either `dynamic: strict` in the mappings if you want to reject all documents that have unmapped fields, or `dynamic: false` to keep accepting any document, but only index the subset of their fields that have a mapping.

---

<div class="post-metadata">

**Author:** ![Praneet\_Khandelwal](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/praneet_khandelwal/32/40565_2.png) [@Praneet\_Khandelwal](https://discuss.elastic.co/u/Praneet_Khandelwal)\
**Post date:** [February 22, 2019, 9:47am UTC](https://discuss.elastic.co/t/disable-indexing-for-all-fields-by-default/169342/3 "2019-02-22T09:47:47Z")

</div>

Actually using dynamic:false would only ensure that no extra field gets indexed. But I want to disable indexing for all the fields in my mapping and just define their datatypes manually.

---

<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:** [March 22, 2019, 9:47am UTC](https://discuss.elastic.co/t/disable-indexing-for-all-fields-by-default/169342/4 "2019-03-22T09:47:50Z")

</div>

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