# Keyword type schema difference Elasticsearch 5.1 with 5.5

**URL:** <https://discuss.elastic.co/t/keyword-type-schema-difference-elasticsearch-5-1-with-5-5/100173>\
**Category:** Elasticsearch\
**Created:** [September 12, 2017, 8:39am UTC](https://discuss.elastic.co/t/keyword-type-schema-difference-elasticsearch-5-1-with-5-5/100173 "2017-09-12T08:39:11Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![sharon.c](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sharon.c/32/16076_2.png) [@sharon.c](https://discuss.elastic.co/u/sharon.c)\
**Post date:** [September 12, 2017, 8:39am UTC](https://discuss.elastic.co/t/keyword-type-schema-difference-elasticsearch-5-1-with-5-5/100173/1 "2017-09-12T08:39:11Z")

</div>

I have been using elasticsearch 2.X to 5.1 for quite some time for aggregation. The business logic does not need the string fields to be analysed.  
In 5.1 when I set the field type as follows in the mapping template:  
"myfield\_name" : {  
"type" : "keyword"  
},  
I can see in kibana management -\> index pattern , the field definition is like this

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/0/3/031a211b2844639567a9835705f55704c6257e08.png)

But when I am trying out elasticsearch 5.5, the same setting of  
"myfield\_name" : {  
"type" : "keyword"  
},  
Kibana index pattern shows there are two fields: myfield\_name and myfield\_name.keyword  
 ![image](https://us1.discourse-cdn.com/elastic/original/3X/b/f/bf1c2fbd8350f107a8c0d9434c06e311705787eb.jpg)

Will it waste space in 5.5 to have two fields of different type to represent one field?  
How can I define the schema to only have 1 field like elasticsearch 5.1?

---

<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:** [September 12, 2017, 8:44am UTC](https://discuss.elastic.co/t/keyword-type-schema-difference-elasticsearch-5-1-with-5-5/100173/2 "2017-09-12T08:44:48Z")

</div>

Are you using Logstash?

---

<div class="post-metadata">

**Author:** ![sharon.c](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sharon.c/32/16076_2.png) [@sharon.c](https://discuss.elastic.co/u/sharon.c)\
**Post date:** [September 12, 2017, 4:34pm UTC](https://discuss.elastic.co/t/keyword-type-schema-difference-elasticsearch-5-1-with-5-5/100173/3 "2017-09-12T16:34:32Z")

</div>

Yes, I am using logstash 5.5

---

<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:** [September 12, 2017, 10:43pm UTC](https://discuss.elastic.co/t/keyword-type-schema-difference-elasticsearch-5-1-with-5-5/100173/4 "2017-09-12T22:43:19Z")

</div>

Then chances are that your template is not matching, and so the default Logstash one applies, which creates both a text and a keyword mapping of the field.

---

<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:** [September 13, 2017, 9:58am UTC](https://discuss.elastic.co/t/keyword-type-schema-difference-elasticsearch-5-1-with-5-5/100173/6 "2017-09-13T09:58:46Z")

</div>

It'd be better if you raised another thread please.  
That way we can help you directly and ask more relevant questions 🙂

---

<div class="post-metadata">

**Author:** ![surj08](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/surj08/32/22083_2.png) [@surj08](https://discuss.elastic.co/u/surj08)\
**Post date:** [September 13, 2017, 3:12pm UTC](https://discuss.elastic.co/t/keyword-type-schema-difference-elasticsearch-5-1-with-5-5/100173/7 "2017-09-13T15:12:12Z")

</div>

Done! Thank you and sorry 🙂

---

<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:** [October 11, 2017, 3:12pm UTC](https://discuss.elastic.co/t/keyword-type-schema-difference-elasticsearch-5-1-with-5-5/100173/8 "2017-10-11T15:12:45Z")

</div>

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