# Dynamic field mapping restrictions

**URL:** <https://discuss.elastic.co/t/dynamic-field-mapping-restrictions/8882>\
**Category:** Elasticsearch\
**Created:** [August 29, 2012, 3:29pm UTC](https://discuss.elastic.co/t/dynamic-field-mapping-restrictions/8882 "2012-08-29T15:29:21Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Rauan\_Maemirov](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rauan_maemirov/32/826_2.png) [@Rauan\_Maemirov](https://discuss.elastic.co/u/Rauan_Maemirov)\
**Post date:** [August 29, 2012, 3:29pm UTC](https://discuss.elastic.co/t/dynamic-field-mapping-restrictions/8882/1 "2012-08-29T15:29:21Z")

</div>

I hit a restriction when dynamically added field mapping couldn't be  
changed. [http://www.elasticsearch.org/guide/reference/mapping/object-type.html](http://www.elasticsearch.org/guide/reference/mapping/object-type.html)  
Why is it so strict?

If there are some issues with file format, maybe it could be allowed at  
least _store_ values as is?  
I mean, if first added field was string, float or int values could be added  
as string, without raising an exception'MapperParsingException[Failed to  
parse [field\_name]];'?

--

---

<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:** [August 29, 2012, 9:35pm UTC](https://discuss.elastic.co/t/dynamic-field-mapping-restrictions/8882/2 "2012-08-29T21:35:32Z")

</div>

The main problem comes when a dynamic field is dynamically introduced as a number, so its type is set to a number, but then you try and index a string to it. It will fail because a numeric value and a string value are indexed very differently.

In 0.19.9 you can set on the numeric values a setting that set it to be ignore\_malformed to true. What you can't actually do is set it as a global setting for an index. That can prove useful, open an issue?

On Aug 29, 2012, at 6:29 PM, Rauan Maemirov [rauan1987@gmail.com](mailto:rauan1987@gmail.com) wrote:

> I hit a restriction when dynamically added field mapping couldn't be changed. [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/guide/reference/mapping/object-type.html)  
> Why is it so strict?
> 
> If there are some issues with file format, maybe it could be allowed at least _store_ values as is?  
> I mean, if first added field was string, float or int values could be added as string, without raising an exception'MapperParsingException[Failed to parse [field\_name]];'?
> 
> --

--

---

<div class="post-metadata">

**Author:** ![Rauan\_Maemirov](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rauan_maemirov/32/826_2.png) [@Rauan\_Maemirov](https://discuss.elastic.co/u/Rauan_Maemirov)\
**Post date:** [August 31, 2012, 4:32am UTC](https://discuss.elastic.co/t/dynamic-field-mapping-restrictions/8882/3 "2012-08-31T04:32:06Z")

</div>

Here it is: [Mapping: `index.mapping.ignore_malformed` global index setting · Issue #2220 · elastic/elasticsearch · GitHub](https://github.com/elasticsearch/elasticsearch/issues/2220)

Le jeudi 30 août 2012 03:35:34 UTC+6, kimchy a écrit :

> The main problem comes when a dynamic field is dynamically introduced as a  
> number, so its type is set to a number, but then you try and index a string  
> to it. It will fail because a numeric value and a string value are indexed  
> very differently.
> 
> In 0.19.9 you can set on the numeric values a setting that set it to be  
> ignore\_malformed to true. What you can't actually do is set it as a global  
> setting for an index. That can prove useful, open an issue?
> 
> On Aug 29, 2012, at 6:29 PM, Rauan Maemirov \<[raua...@gmail.com](mailto:raua...@gmail.com)\<javascript:\>\>  
> wrote:
> 
> I hit a restriction when dynamically added field mapping couldn't be  
> changed.  
> [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/guide/reference/mapping/object-type.html)  
> Why is it so strict?
> 
> If there are some issues with file format, maybe it could be allowed at  
> least _store_ values as is?  
> I mean, if first added field was string, float or int values could be  
> added as string, without raising an exception'MapperParsingException[Failed  
> to parse [field\_name]];'?
> 
> --

--

---

<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, 3:14am UTC](https://discuss.elastic.co/t/dynamic-field-mapping-restrictions/8882/4 "2017-07-06T03:14:29Z")

</div>


