# Text VS Keyword

**URL:** <https://discuss.elastic.co/t/text-vs-keyword/137532>\
**Category:** Elasticsearch\
**Created:** [June 27, 2018, 3:10am UTC](https://discuss.elastic.co/t/text-vs-keyword/137532 "2018-06-27T03:10:53Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![safhw91](https://avatars.discourse-cdn.com/v4/letter/s/eb9ed0/32.png) [@safhw91](https://discuss.elastic.co/u/safhw91)\
**Post date:** [June 27, 2018, 3:10am UTC](https://discuss.elastic.co/t/text-vs-keyword/137532/1 "2018-06-27T03:10:54Z")

</div>

I am going to set my string as not indexed by elastic via mapping. So I do not need ANY search, aggregation, etc, whatsoever for certain strings.

I just need the string to come out together with other data when I search for other data.

Would "keyword" or "text" be more efficient if I care about memory usage?

Thanks!

---

<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:** [June 27, 2018, 3:28am UTC](https://discuss.elastic.co/t/text-vs-keyword/137532/2 "2018-06-27T03:28:01Z")

</div>

Keyword is the best for this.

---

<div class="post-metadata">

**Author:** ![safhw91](https://avatars.discourse-cdn.com/v4/letter/s/eb9ed0/32.png) [@safhw91](https://discuss.elastic.co/u/safhw91)\
**Post date:** [June 27, 2018, 3:31am UTC](https://discuss.elastic.co/t/text-vs-keyword/137532/3 "2018-06-27T03:31:43Z")

</div>

Thank you!

---

<div class="post-metadata">

**Author:** ![forloop](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/forloop/32/9021_2.png) [@forloop](https://discuss.elastic.co/u/forloop)\
**Post date:** [June 27, 2018, 3:56am UTC](https://discuss.elastic.co/t/text-vs-keyword/137532/4 "2018-06-27T03:56:15Z")

</div>

> [@safhw91](#):
>
> So I do not need ANY search, aggregation, etc, whatsoever for certain strings.

You should also set [`index: false`](https://www.elastic.co/guide/en/elasticsearch/reference/current/mapping-index.html) in the mapping for these fields; this means that the field will not be _indexed for search_, but will still be stored as part of the `_source` document returned.

---

<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 25, 2018, 3:56am UTC](https://discuss.elastic.co/t/text-vs-keyword/137532/5 "2018-07-25T03:56:16Z")

</div>

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