# ES 5.1.2 dynamic mapping different in 2 identical environments

**URL:** <https://discuss.elastic.co/t/es-5-1-2-dynamic-mapping-different-in-2-identical-environments/77428>\
**Category:** Elasticsearch\
**Created:** [March 5, 2017, 7:37pm UTC](https://discuss.elastic.co/t/es-5-1-2-dynamic-mapping-different-in-2-identical-environments/77428 "2017-03-05T19:37:26Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![dougbergh](https://avatars.discourse-cdn.com/v4/letter/d/b487fb/32.png) [@dougbergh](https://discuss.elastic.co/u/dougbergh)\
**Post date:** [March 5, 2017, 7:37pm UTC](https://discuss.elastic.co/t/es-5-1-2-dynamic-mapping-different-in-2-identical-environments/77428/1 "2017-03-05T19:37:26Z")

</div>

I have two environments, both running Elastic Search v. 5.1.2. I have no default mapping templates.

ES is creating a different mapping for the same field, in the two environments, as below. I could create a template, but I would rather not because it's work...anyone know why this might occur?

It's logstash, and I've looked at the first entries in the index (using kibana), and they appear identical to me.

env1:  
"user\_uuid": {  
"type": "text",  
"norms": false,  
"fields": {  
"keyword": {  
"type": "keyword"  
}  
}  
},

env2:  
"user\_uuid": {  
"type": "text",  
"norms": false,  
"fields": {  
"raw": {  
"type": "keyword",  
"ignore\_above": 256  
}  
}  
},

Note the type in env1 is "raw", that in env2 is "keyword". I expect "keyword", based on this article: [https://www.elastic.co/blog/strings-are-dead-long-live-strings](https://www.elastic.co/blog/strings-are-dead-long-live-strings).

The es versions are:  
env1:  
"version" : {  
"number" : "5.1.2",  
"build\_hash" : "c8c4c16",  
"build\_date" : "2017-01-11T20:18:39.146Z",  
"build\_snapshot" : false,  
"lucene\_version" : "6.3.0"  
},

env2:  
"version" : {  
"number" : "5.1.2",  
"build\_hash" : "c8c4c16",  
"build\_date" : "2017-01-11T20:18:39.146Z",  
"build\_snapshot" : false,  
"lucene\_version" : "6.3.0"  
},

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [March 5, 2017, 9:05pm UTC](https://discuss.elastic.co/t/es-5-1-2-dynamic-mapping-different-in-2-identical-environments/77428/2 "2017-03-05T21:05:10Z")

</div>

> [@dougbergh](#):
>
> Note the type in env1 is "raw", that in env2 is "keyword"

There's 2 fields here.

`user_uuid`, `user_uuid.raw` in env1 and `user_uuid` in env2.

The `.raw` usually won't be created by default though, it's something you need to specify. Are you sure there is no template for it?

---

<div class="post-metadata">

**Author:** ![dougbergh](https://avatars.discourse-cdn.com/v4/letter/d/b487fb/32.png) [@dougbergh](https://discuss.elastic.co/u/dougbergh)\
**Post date:** [March 6, 2017, 4:01pm UTC](https://discuss.elastic.co/t/es-5-1-2-dynamic-mapping-different-in-2-identical-environments/77428/3 "2017-03-06T16:01:56Z")

</div>

Thanks for the reply! It's helpful!  
I'm not sure what you mean, though. I think there is one field in each env; in env1 it's called 'keyword' and in env2 it's called 'raw'. Each if of type 'keyword'.  
I'm pretty sure there's no template, but I'm not 100%. I'll check that..  
BTW I couldn't figure out how to show the mappings with indentations - that would make it clearer. Do you know how?

---

<div class="post-metadata">

**Author:** ![dougbergh](https://avatars.discourse-cdn.com/v4/letter/d/b487fb/32.png) [@dougbergh](https://discuss.elastic.co/u/dougbergh)\
**Post date:** [March 6, 2017, 4:14pm UTC](https://discuss.elastic.co/t/es-5-1-2-dynamic-mapping-different-in-2-identical-environments/77428/4 "2017-03-06T16:14:19Z")

</div>

@warkolm, you were right! There are dynamic templates and they're different! I thought 'string' type ceased to exist in 5.0; the templates may have been created when we were running on 2.x. Thanks again!!

env1:  
"dynamic\_templates": [  
{  
"message\_field": {  
"path\_match": "message",  
"match\_mapping\_type": "string",  
"mapping": {  
"norms": false,  
"type": "text"  
}  
}  
},  
{  
"string\_fields": {  
"match": "\*",  
"match\_mapping\_type": "string",  
"mapping": {  
"fields": {  
"keyword": {  
"type": "keyword"  
}  
},  
"norms": false,  
"type": "text"  
}  
}  
}  
],

env2:  
"dynamic\_templates": [  
{  
"message\_field": {  
"match": "message",  
"match\_mapping\_type": "string",  
"mapping": {  
"fielddata": {  
"format": "disabled"  
},  
"index": "analyzed",  
"omit\_norms": true,  
"type": "string"  
}  
}  
},  
{  
"string\_fields": {  
"match": "\*",  
"match\_mapping\_type": "string",  
"mapping": {  
"fielddata": {  
"format": "disabled"  
},  
"fields": {  
"raw": {  
"ignore\_above": 256,  
"index": "not\_analyzed",  
"type": "string"  
}  
},  
"index": "analyzed",  
"omit\_norms": true,  
"type": "string"  
}  
}  
}  
],

---

<div class="post-metadata">

**Author:** ![dougbergh](https://avatars.discourse-cdn.com/v4/letter/d/b487fb/32.png) [@dougbergh](https://discuss.elastic.co/u/dougbergh)\
**Post date:** [March 9, 2017, 3:58pm UTC](https://discuss.elastic.co/t/es-5-1-2-dynamic-mapping-different-in-2-identical-environments/77428/5 "2017-03-09T15:58:55Z")

</div>

...so it turns out we didn't create those templates, es did...so i've asked a different question: es 5.1.2 creating dynamic\_template with raw...

---

<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:** [April 6, 2017, 3:59pm UTC](https://discuss.elastic.co/t/es-5-1-2-dynamic-mapping-different-in-2-identical-environments/77428/6 "2017-04-06T15:59:09Z")

</div>

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