# Disable Mapping for core types like string,long

**URL:** <https://discuss.elastic.co/t/disable-mapping-for-core-types-like-string-long/2507>\
**Category:** Elasticsearch\
**Created:** [June 11, 2015, 6:35pm UTC](https://discuss.elastic.co/t/disable-mapping-for-core-types-like-string-long/2507 "2015-06-11T18:35:32Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![saiprasad\_mishra](https://avatars.discourse-cdn.com/v4/letter/s/da6949/32.png) [@saiprasad\_mishra](https://discuss.elastic.co/u/saiprasad_mishra)\
**Post date:** [June 11, 2015, 6:35pm UTC](https://discuss.elastic.co/t/disable-mapping-for-core-types-like-string-long/2507/1 "2015-06-11T18:35:33Z")

</div>

I am on 1.3.2 version of ES

I have a requirement for disabling some core type fileds in some objects (neither index nor put it in mapping)

Is there anyway to remove a string field from mapping in a dynamic template where for e.g a.myobj.\*.values.attributeId ( \* could be brand,color etc as an object in this example) should not be mapped apart from just saying index="no" to avoid the mapping file to grow very large.

"enabled" : false is working only for an object type.

Any help much appreciated

Regards  
Sai

---

<div class="post-metadata">

**Author:** ![radu\_gheorghe](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/radu_gheorghe/32/556_2.png) [@radu\_gheorghe](https://discuss.elastic.co/u/radu_gheorghe)\
**Post date:** [June 12, 2015, 9:26am UTC](https://discuss.elastic.co/t/disable-mapping-for-core-types-like-string-long/2507/2 "2015-06-12T09:26:34Z")

</div>

Hello Sai,

I did some tests (with ES 1.6) and the only solution I see is to define the mapping statically (i.e. each time you need a new field, append it to the mapping) and set **dynamic** to **false**. If a document has a field that's not defined in the document, it will still be in \_source, but it won't be added to the mapping (and of course not indexed or stored separately).

With dynamic mappings, I couldn't find a solution. As you said, enabled=false doesn't work for core types and if you combine dynamic=false with dynamic\_templates, then dynamic=false takes over, and dynamic templates are ignored.

Best regards,  
Radu

---

<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 6, 2017, 12:07am UTC](https://discuss.elastic.co/t/disable-mapping-for-core-types-like-string-long/2507/3 "2017-07-06T00:07:55Z")

</div>


