# Dynamic mapping questions

**URL:** <https://discuss.elastic.co/t/dynamic-mapping-questions/3907>\
**Category:** Elasticsearch\
**Created:** [February 9, 2011, 5:49pm UTC](https://discuss.elastic.co/t/dynamic-mapping-questions/3907 "2011-02-09T17:49:00Z")\
**Posts on this page:** 7\
**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 9, 2011, 5:49pm UTC](https://discuss.elastic.co/t/dynamic-mapping-questions/3907/1 "2011-02-09T17:49:00Z")

</div>

Hi,

Two questions regarding the mapping process.

1. I see for the **object** type you have the field **enabled** in case you don't want to index it in  
subsequent calls. How can you not index a core type field. Meaning you have an initial mapping where you set your fields.  
But some later call to index can have a core type field that I don't want to index. As it is now, correct me if I'm wrong, it  
will get dynamically mapped. How can I avoid that.

2. If I change the mapping I have for a document by adding a new field, dynamically or not, it will cause a re-indexing of the already indexed documents?

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 9, 2011, 7:31pm UTC](https://discuss.elastic.co/t/dynamic-mapping-questions/3907/2 "2011-02-09T19:31:44Z")

</div>

On Wednesday, February 9, 2011 at 7:49 PM, stelios wrote:

> Hi,
> 
> Two questions regarding the mapping process.
> 
> 1. I see for the object type you have the field enabled in case you don't  
> want to index it in  
> subsequent calls. How can you not index a core type field. Meaning you have  
> an initial mapping where you set your fields.  
> But some later call to index can have a core type field that I don't want to  
> index. As it is now, correct me if I'm wrong, it  
> will get dynamically mapped. How can I avoid that.  
> You can set the dynamic flag to false on the root object mapping.
> 
> 2. If I change the mapping I have for a document by adding a new field,  
> dynamically or not, it will cause a re-indexing of the already indexed  
> documents?  
> No, you don't need to reindex. Introducing new fields does not require reindexing.
> 
> ## Thanks stelios
> 
> View this message in context: [http://elasticsearch-users.115913.n3.nabble.com/Dynamic-mapping-questions-tp2460164p2460164.html](http://elasticsearch-users.115913.n3.nabble.com/Dynamic-mapping-questions-tp2460164p2460164.html)  
> Sent from the Elasticsearch Users mailing list archive at [Nabble.com](http://Nabble.com).

---

<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 11, 2011, 4:56pm UTC](https://discuss.elastic.co/t/dynamic-mapping-questions/3907/3 "2011-02-11T16:56:51Z")

</div>

I think I didn't phrase it correctly

consider this json

{  
"analysis": {  
"audio\_info": {  
"1\_0": {  
"successful": true,  
"data": {  
"bits": 16,  
"bitrate": 689.1609186183296,  
"channels": 1,  
"duration": 9.351,  
"samplerate": 44100,  
"type": "wav"  
}  
}  
}  
}

How can I not index the field "successful". When I do a mapping and not  
include this field but then index a document that has this  
field then it gets mapped dynamically. Of course I can set dynamic mapping  
off and it will work as I want but there are other cases where dynamic  
mapping is handy.

Thanks  
Stelios

On 9 February 2011 20:32, kimchy [via Elasticsearch Users] \<  
[ml-node+2461059-13164497-341730@n3.nabble.com](mailto:ml-node+2461059-13164497-341730@n3.nabble.com)\> wrote:

> On Wednesday, February 9, 2011 at 7:49 PM, stelios wrote:
> 
> Hi,
> 
> Two questions regarding the mapping process.
> 
> 1. I see for the object type you have the field enabled in case you don't  
> want to index it in  
> subsequent calls. How can you not index a core type field. Meaning you have  
> an initial mapping where you set your fields.  
> But some later call to index can have a core type field that I don't want  
> to  
> index. As it is now, correct me if I'm wrong, it  
> will get dynamically mapped. How can I avoid that.
> 
> You can set the dynamic flag to false on the root object mapping.
> 
> 1. If I change the mapping I have for a document by adding a new field,  
> dynamically or not, it will cause a re-indexing of the already indexed  
> documents?
> 
> No, you don't need to reindex. Introducing new fields does not require  
> reindexing.
> 
> ## Thanks stelios
> 
> View this message in context:  
> [http://elasticsearch-users.115913.n3.nabble.com/Dynamic-mapping-questions-tp2460164p2460164.html](http://elasticsearch-users.115913.n3.nabble.com/Dynamic-mapping-questions-tp2460164p2460164.html)[http://elasticsearch-users.115913.n3.nabble.com/Dynamic-mapping-questions-tp2460164p2460164.html?by-user=t](http://elasticsearch-users.115913.n3.nabble.com/Dynamic-mapping-questions-tp2460164p2460164.html?by-user=t)  
> Sent from the Elasticsearch Users mailing list archive at [Nabble.com](http://Nabble.com).
> 
> * * *
> 
> If you reply to this email, your message will be added to the discussion  
> below:
> 
> [http://elasticsearch-users.115913.n3.nabble.com/Dynamic-mapping-questions-tp2460164p2461059.html](http://elasticsearch-users.115913.n3.nabble.com/Dynamic-mapping-questions-tp2460164p2461059.html)  
> To unsubscribe from Dynamic mapping questions, click here[http://elasticsearch-users.115913.n3.nabble.com/template/NamlServlet.jtp?macro=unsubscribe\_by\_code&node=2460164&code=c3RldG9naWFzQGdtYWlsLmNvbXwyNDYwMTY0fC0xMDc4NTcwNTM2](http://elasticsearch-users.115913.n3.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=2460164&code=c3RldG9naWFzQGdtYWlsLmNvbXwyNDYwMTY0fC0xMDc4NTcwNTM2).

---

<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 11, 2011, 5:02pm UTC](https://discuss.elastic.co/t/dynamic-mapping-questions/3907/4 "2011-02-11T17:02:17Z")

</div>

Just to clarify I know that I can use "enabled" : false in the "1\_0" object  
so it will not map the "successful" field but it won't map any other fields  
as well. What I really need is to do something like "successful" :  
"not\_mapped". Is this possible at the moment?

thanks  
stelios

On 11 February 2011 17:56, Stelios Togias [stetogias@gmail.com](mailto:stetogias@gmail.com) wrote:

> I think I didn't phrase it correctly
> 
> consider this json
> 
> {  
> "analysis": {  
> "audio\_info": {  
> "1\_0": {  
> "successful": true,  
> "data": {  
> "bits": 16,  
> "bitrate": 689.1609186183296,  
> "channels": 1,  
> "duration": 9.351,  
> "samplerate": 44100,  
> "type": "wav"  
> }  
> }  
> }  
> }
> 
> How can I not index the field "successful". When I do a mapping and not  
> include this field but then index a document that has this  
> field then it gets mapped dynamically. Of course I can set dynamic mapping  
> off and it will work as I want but there are other cases where dynamic  
> mapping is handy.
> 
> Thanks  
> Stelios
> 
> On 9 February 2011 20:32, kimchy [via Elasticsearch Users] \<  
> [ml-node+2461059-13164497-341730@n3.nabble.com](mailto:ml-node+2461059-13164497-341730@n3.nabble.com)\> wrote:
> 
> > On Wednesday, February 9, 2011 at 7:49 PM, stelios wrote:
> > 
> > Hi,
> > 
> > Two questions regarding the mapping process.
> > 
> > 1. I see for the object type you have the field enabled in case you don't  
> > want to index it in  
> > subsequent calls. How can you not index a core type field. Meaning you  
> > have  
> > an initial mapping where you set your fields.  
> > But some later call to index can have a core type field that I don't want  
> > to  
> > index. As it is now, correct me if I'm wrong, it  
> > will get dynamically mapped. How can I avoid that.
> > 
> > You can set the dynamic flag to false on the root object mapping.
> > 
> > 1. If I change the mapping I have for a document by adding a new field,  
> > dynamically or not, it will cause a re-indexing of the already indexed  
> > documents?
> > 
> > No, you don't need to reindex. Introducing new fields does not require  
> > reindexing.
> > 
> > ## Thanks stelios
> > 
> > View this message in context:  
> > [http://elasticsearch-users.115913.n3.nabble.com/Dynamic-mapping-questions-tp2460164p2460164.html](http://elasticsearch-users.115913.n3.nabble.com/Dynamic-mapping-questions-tp2460164p2460164.html)[http://elasticsearch-users.115913.n3.nabble.com/Dynamic-mapping-questions-tp2460164p2460164.html?by-user=t](http://elasticsearch-users.115913.n3.nabble.com/Dynamic-mapping-questions-tp2460164p2460164.html?by-user=t)  
> > Sent from the Elasticsearch Users mailing list archive at [Nabble.com](http://Nabble.com).
> > 
> > * * *
> > 
> > If you reply to this email, your message will be added to the discussion  
> > below:
> > 
> > [http://elasticsearch-users.115913.n3.nabble.com/Dynamic-mapping-questions-tp2460164p2461059.html](http://elasticsearch-users.115913.n3.nabble.com/Dynamic-mapping-questions-tp2460164p2461059.html)  
> > To unsubscribe from Dynamic mapping questions, click here[http://elasticsearch-users.115913.n3.nabble.com/template/NamlServlet.jtp?macro=unsubscribe\_by\_code&node=2460164&code=c3RldG9naWFzQGdtYWlsLmNvbXwyNDYwMTY0fC0xMDc4NTcwNTM2](http://elasticsearch-users.115913.n3.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=2460164&code=c3RldG9naWFzQGdtYWlsLmNvbXwyNDYwMTY0fC0xMDc4NTcwNTM2).

---

<div class="post-metadata">

**Author:** ![Clinton\_Gormley](https://avatars.discourse-cdn.com/v4/letter/c/50afbb/32.png) [@Clinton\_Gormley](https://discuss.elastic.co/u/Clinton_Gormley)\
**Post date:** [February 11, 2011, 5:03pm UTC](https://discuss.elastic.co/t/dynamic-mapping-questions/3907/5 "2011-02-11T17:03:04Z")

</div>

> How can I not index the field "successful". When I do a mapping and  
> not include this field but then index a document that has this  
> field then it gets mapped dynamically. Of course I can set dynamic  
> mapping off and it will work as I want but there are other cases where  
> dynamic mapping is handy.

Have a look at "index": "analyzed|not\_analyzed|no" on this page:

> **[Elasticsearch Platform — Find real-time answers at scale](https://www.elastic.co)**
>
> Power insights and outcomes with the Elasticsearch Platform and AI. See into your data and find answers that matter with enterprise solutions designed to help you build, observe, and protect. Try Elasticsearch free today.

clint

---

<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 11, 2011, 6:10pm UTC](https://discuss.elastic.co/t/dynamic-mapping-questions/3907/6 "2011-02-11T18:10:46Z")

</div>

oops...missed it...

thanks  
stelios

On 11 February 2011 18:03, Clinton Gormley [via Elasticsearch Users] \<  
[ml-node+2475031-624462903-341730@n3.nabble.com](mailto:ml-node+2475031-624462903-341730@n3.nabble.com)\> wrote:

> > How can I not index the field "successful". When I do a mapping and  
> > not include this field but then index a document that has this  
> > field then it gets mapped dynamically. Of course I can set dynamic  
> > mapping off and it will work as I want but there are other cases where  
> > dynamic mapping is handy.
> 
> Have a look at "index": "analyzed|not\_analyzed|no" on this page:
> 
> [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/guide/reference/mapping/core-types.html)
> 
> clint
> 
> * * *
> 
> If you reply to this email, your message will be added to the discussion  
> below:
> 
> [http://elasticsearch-users.115913.n3.nabble.com/Dynamic-mapping-questions-tp2460164p2475031.html](http://elasticsearch-users.115913.n3.nabble.com/Dynamic-mapping-questions-tp2460164p2475031.html)  
> To unsubscribe from Dynamic mapping questions, click here[http://elasticsearch-users.115913.n3.nabble.com/template/NamlServlet.jtp?macro=unsubscribe\_by\_code&node=2460164&code=c3RldG9naWFzQGdtYWlsLmNvbXwyNDYwMTY0fC0xMDc4NTcwNTM2](http://elasticsearch-users.115913.n3.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=2460164&code=c3RldG9naWFzQGdtYWlsLmNvbXwyNDYwMTY0fC0xMDc4NTcwNTM2).

---

<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/dynamic-mapping-questions/3907/7 "2017-07-06T04:12:11Z")

</div>


