# Mapping template - how to disable analyze / keyword?

**URL:** <https://discuss.elastic.co/t/mapping-template-how-to-disable-analyze-keyword/72777>\
**Category:** Elasticsearch\
**Created:** [January 25, 2017, 1:17pm UTC](https://discuss.elastic.co/t/mapping-template-how-to-disable-analyze-keyword/72777 "2017-01-25T13:17:00Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![asp](https://avatars.discourse-cdn.com/v4/letter/a/9fc348/32.png) [@asp](https://discuss.elastic.co/u/asp)\
**Post date:** [January 25, 2017, 1:17pm UTC](https://discuss.elastic.co/t/mapping-template-how-to-disable-analyze-keyword/72777/1 "2017-01-25T13:17:01Z")

</div>

Hi,  
I need to store a message, which is bigger than 32k which is the max of lucene.

As I understand I need to create an index template and define the mapping for that field. And there I have to turn of the analyzer.

I exported the mapping of the field, here is the snippet:

```
"message_full_not_analyzed": {
            "type": "text",
            "fields": {
              "keyword": {
                "type": "keyword",
                "ignore_above": 256
              }
            }

```

What do I need to change, to disable the analysis of this field?  
Just deleting the fields object?

Thanks, Andreas

---

<div class="post-metadata">

**Author:** ![Mark\_Harwood](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mark_harwood/32/10538_2.png) [@Mark\_Harwood](https://discuss.elastic.co/u/Mark_Harwood)\
**Post date:** [January 25, 2017, 2:23pm UTC](https://discuss.elastic.co/t/mapping-template-how-to-disable-analyze-keyword/72777/2 "2017-01-25T14:23:03Z")

</div>

What do you want to be able to do with this field?

Right now the mapping you have provided treats it for two purposes:

1. Search - the `text` type means it is analyzed so you can search for individual words in the message
2. sorting/aggregating - the `keyword` is not analyzed so it can be treated as a single token in the index (if \< 256 characters which avoids the 32k Lucene limit)

The correct mapping depends on what you want to do with the field's contents.

---

<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:** [February 22, 2017, 2:23pm UTC](https://discuss.elastic.co/t/mapping-template-how-to-disable-analyze-keyword/72777/3 "2017-02-22T14:23:04Z")

</div>

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