# How to omit a builtin type from mapping

**URL:** <https://discuss.elastic.co/t/how-to-omit-a-builtin-type-from-mapping/3885>\
**Category:** Elasticsearch\
**Created:** [February 4, 2011, 6:01pm UTC](https://discuss.elastic.co/t/how-to-omit-a-builtin-type-from-mapping/3885 "2011-02-04T18:01:41Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![stelios](https://avatars.discourse-cdn.com/v4/letter/s/8dc957/32.png) [@stelios](https://discuss.elastic.co/u/stelios)\
**Post date:** [February 4, 2011, 6:01pm UTC](https://discuss.elastic.co/t/how-to-omit-a-builtin-type-from-mapping/3885/1 "2011-02-04T18:01:41Z")

</div>

Let's say I have a mapping like the below and don't want to map the  
last\_name, while using dynamic mapping.  
In the tests I did indexing a document with fields not in the initial  
mapping will cause these fields to be mapped as well. Which is  
something I want but not for all fields.  
I see the object type has an enabled feature. Anything similar for a  
simple field?  
{  
"tweet" : {  
"properties" : {  
"person" : {  
"type" : "object",  
"properties" : {  
"name" : {  
"properties" : {  
"first\_name" : {"type" : "string"},  
"last\_name" : {"type" : "string"}  
}  
},  
"sid" : {"type" : "string", "index" :  
"not\_analyzed"}  
}  
}  
"message" : {"type" : "string"}  
}  
}  
}

thanks  
stelios

---

<div class="post-metadata">

**Author:** ![kimchy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kimchy/32/44952_2.png) [@kimchy](https://discuss.elastic.co/u/kimchy)\
**Post date:** [February 7, 2011, 6:07pm UTC](https://discuss.elastic.co/t/how-to-omit-a-builtin-type-from-mapping/3885/2 "2011-02-07T18:07:51Z")

</div>

you can set the "index" : "no" in the mapping for last\_name, then it won't be indexed (and not stored, as this is the default), so it won't be added to the Document indexed.  
On Friday, February 4, 2011 at 8:01 PM, stelios wrote:

> Let's say I have a mapping like the below and don't want to map the  
> last\_name, while using dynamic mapping.  
> In the tests I did indexing a document with fields not in the initial  
> mapping will cause these fields to be mapped as well. Which is  
> something I want but not for all fields.  
> I see the object type has an enabled feature. Anything similar for a  
> simple field?  
> {  
> "tweet" : {  
> "properties" : {  
> "person" : {  
> "type" : "object",  
> "properties" : {  
> "name" : {  
> "properties" : {  
> "first\_name" : {"type" : "string"},  
> "last\_name" : {"type" : "string"}  
> }  
> },  
> "sid" : {"type" : "string", "index" :  
> "not\_analyzed"}  
> }  
> }  
> "message" : {"type" : "string"}  
> }  
> }  
> }
> 
> thanks  
> stelios

---

<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, 4:12am UTC](https://discuss.elastic.co/t/how-to-omit-a-builtin-type-from-mapping/3885/3 "2017-07-06T04:12:30Z")

</div>


