# What will be the beneficial if I do not analyze a text field?

**URL:** <https://discuss.elastic.co/t/what-will-be-the-beneficial-if-i-do-not-analyze-a-text-field/169408>\
**Category:** Elasticsearch\
**Created:** [February 21, 2019, 12:26pm UTC](https://discuss.elastic.co/t/what-will-be-the-beneficial-if-i-do-not-analyze-a-text-field/169408 "2019-02-21T12:26:51Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Kramer\_Li](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kramer_li/32/46872_2.png) [@Kramer\_Li](https://discuss.elastic.co/u/Kramer_Li)\
**Post date:** [February 21, 2019, 12:26pm UTC](https://discuss.elastic.co/t/what-will-be-the-beneficial-if-i-do-not-analyze-a-text-field/169408/1 "2019-02-21T12:26:51Z")

</div>

I find that some of my data has to be stored as text field (The are long, not used for sort, aggregation).

But I also do not need to search based on the content of these fields. So I think I should specify the field not being analyzed.

I want to know what would be the beneficial if I do not analyze a text field?

There should be some since I let the elasticsearch doing less work, right?

For example:

Will this improve the index speed?  
Will this improve the query speed?  
Does this save space?

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [February 21, 2019, 12:44pm UTC](https://discuss.elastic.co/t/what-will-be-the-beneficial-if-i-do-not-analyze-a-text-field/169408/2 "2019-02-21T12:44:06Z")

</div>

Yes to 1 and 3 if you only index fields as keywords and not both as default mapping is doing.

---

<div class="post-metadata">

**Author:** ![Kramer\_Li](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kramer_li/32/46872_2.png) [@Kramer\_Li](https://discuss.elastic.co/u/Kramer_Li)\
**Post date:** [February 22, 2019, 2:56am UTC](https://discuss.elastic.co/t/what-will-be-the-beneficial-if-i-do-not-analyze-a-text-field/169408/3 "2019-02-22T02:56:09Z")

</div>

“you only index fields as keywords and not both as default mapping is doing.”

Sorry, I do not understand what this mean..

The way I do to make my text fields without being analyzed is to define the mapping like this

```
"mapping": {
    "my_type": {
        "properties": {
            "search_key": {"type": "keyword"},
            "content": {"type": "text", "index": false}
        }
    } 
}

```

The content field is the text field. I hope the index: false setting means that es will not analyze the fields, since the index:false means the fields not searchable

Am I doing correct?

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [February 22, 2019, 2:55pm UTC](https://discuss.elastic.co/t/what-will-be-the-beneficial-if-i-do-not-analyze-a-text-field/169408/4 "2019-02-22T14:55:33Z")

</div>

If you don't need to search `content` field, then that's correct to me.  
`index: false` indeed says that the field is not indexed, which means that it does not have to be analyzed as well.

You'll be able to do exact search on `search_key`, sorting, and aggregations as well.

---

<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:** [March 22, 2019, 2:55pm UTC](https://discuss.elastic.co/t/what-will-be-the-beneficial-if-i-do-not-analyze-a-text-field/169408/5 "2019-03-22T14:55:47Z")

</div>

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