# What is the difference between keyword type vs. text type with keyword analyzer?

**URL:** <https://discuss.elastic.co/t/what-is-the-difference-between-keyword-type-vs-text-type-with-keyword-analyzer/81176>\
**Category:** Elasticsearch\
**Created:** [April 4, 2017, 4:18pm UTC](https://discuss.elastic.co/t/what-is-the-difference-between-keyword-type-vs-text-type-with-keyword-analyzer/81176 "2017-04-04T16:18:11Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![dng](https://avatars.discourse-cdn.com/v4/letter/d/858c86/32.png) [@dng](https://discuss.elastic.co/u/dng)\
**Post date:** [April 4, 2017, 4:18pm UTC](https://discuss.elastic.co/t/what-is-the-difference-between-keyword-type-vs-text-type-with-keyword-analyzer/81176/1 "2017-04-04T16:18:11Z")

</div>

What is the difference between using the keyword type vs. text type with the keyword analyzer?

E.g.

- If I need to index a guid, which would I pick?
- If i need to index a single word, which would I pick?

Thanks!

---

<div class="post-metadata">

**Author:** ![nik9000](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/nik9000/32/44947_2.png) [@nik9000](https://discuss.elastic.co/u/nik9000)\
**Post date:** [April 5, 2017, 2:21pm UTC](https://discuss.elastic.co/t/what-is-the-difference-between-keyword-type-vs-text-type-with-keyword-analyzer/81176/2 "2017-04-05T14:21:34Z")

</div>

The `keyword` type is named after the `keyword` analyzer. The idea is that single-token strings can support more things than multi-token strings and `keyword` was the analyzer that made single token strings. Thus, the name.

I'd use `keyword` for guids, certainly. I'd turn off `doc_values` if you don't need them.

I'd probably use `text` for a single word if the word is language and `keyword` if the word is some kind of "flag" or "keyword" or something. If you want language analysis stuff then you want `text`. If you want sorting or aggregating on it, then you want `keyword`.

---

<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:** [May 3, 2017, 2:21pm UTC](https://discuss.elastic.co/t/what-is-the-difference-between-keyword-type-vs-text-type-with-keyword-analyzer/81176/3 "2017-05-03T14:21:41Z")

</div>

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