# "Alternatively use a keyword field instead." error for keyword field

**URL:** <https://discuss.elastic.co/t/alternatively-use-a-keyword-field-instead-error-for-keyword-field/133205>\
**Category:** Elasticsearch\
**Created:** [May 24, 2018, 5:55pm UTC](https://discuss.elastic.co/t/alternatively-use-a-keyword-field-instead-error-for-keyword-field/133205 "2018-05-24T17:55:24Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![orogvany](https://avatars.discourse-cdn.com/v4/letter/o/a183cd/32.png) [@orogvany](https://discuss.elastic.co/u/orogvany)\
**Post date:** [May 24, 2018, 5:55pm UTC](https://discuss.elastic.co/t/alternatively-use-a-keyword-field-instead-error-for-keyword-field/133205/1 "2018-05-24T17:55:24Z")

</div>

Hi, I'm attempting to sort on a keyword field, and I get "Fielddata is disabled on text fields by default. Set fielddata=true on [guid] in order to load fielddata in memory by uninverting the inverted index. Note that this can however use significant memory. Alternatively use a keyword field instead."

The mapping for this field is  
"guid" : {  
"type" : "keyword"  
},

Any ideas why it isn't honoring the keyword type?

ES 6.2.x

---

<div class="post-metadata">

**Author:** ![polyfractal](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/polyfractal/32/48162_2.png) [@polyfractal](https://discuss.elastic.co/u/polyfractal)\
**Post date:** [May 24, 2018, 6:12pm UTC](https://discuss.elastic.co/t/alternatively-use-a-keyword-field-instead-error-for-keyword-field/133205/2 "2018-05-24T18:12:08Z")

</div>

Hm, does the search happen to span across multiple indices? It's possible one of the indices in the search has a different mapping for that field.

---

<div class="post-metadata">

**Author:** ![orogvany](https://avatars.discourse-cdn.com/v4/letter/o/a183cd/32.png) [@orogvany](https://discuss.elastic.co/u/orogvany)\
**Post date:** [May 24, 2018, 6:23pm UTC](https://discuss.elastic.co/t/alternatively-use-a-keyword-field-instead-error-for-keyword-field/133205/3 "2018-05-24T18:23:17Z")

</div>

It does span multiple indices. We use aliases for routing, so one may be pointed at an older schema.

I'll regenerate and check routing

Thanks!

---

<div class="post-metadata">

**Author:** ![polyfractal](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/polyfractal/32/48162_2.png) [@polyfractal](https://discuss.elastic.co/u/polyfractal)\
**Post date:** [May 24, 2018, 6:24pm UTC](https://discuss.elastic.co/t/alternatively-use-a-keyword-field-instead-error-for-keyword-field/133205/4 "2018-05-24T18:24:03Z")

</div>

Np, happy to help! 🙂

---

<div class="post-metadata">

**Author:** ![orogvany](https://avatars.discourse-cdn.com/v4/letter/o/a183cd/32.png) [@orogvany](https://discuss.elastic.co/u/orogvany)\
**Post date:** [May 24, 2018, 10:20pm UTC](https://discuss.elastic.co/t/alternatively-use-a-keyword-field-instead-error-for-keyword-field/133205/5 "2018-05-24T22:20:57Z")

</div>

Yea, that was the issue, thanks!

---

<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:** [June 21, 2018, 10:21pm UTC](https://discuss.elastic.co/t/alternatively-use-a-keyword-field-instead-error-for-keyword-field/133205/6 "2018-06-21T22:21:00Z")

</div>

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