# Fielddata is disabled, but I have added a keyword field

**URL:** <https://discuss.elastic.co/t/fielddata-is-disabled-but-i-have-added-a-keyword-field/222353>\
**Category:** Elasticsearch\
**Created:** [March 5, 2020, 6:37pm UTC](https://discuss.elastic.co/t/fielddata-is-disabled-but-i-have-added-a-keyword-field/222353 "2020-03-05T18:37:31Z")\
**Posts on this page:** 12\
**Page:** 2

<div class="post-metadata">

**Author:** ![Terran](https://avatars.discourse-cdn.com/v4/letter/t/94ad74/32.png) [@Terran](https://discuss.elastic.co/u/Terran)\
**Post date:** [March 17, 2020, 10:50am UTC](https://discuss.elastic.co/t/fielddata-is-disabled-but-i-have-added-a-keyword-field/222353/21 "2020-03-17T10:50:48Z")

</div>

Sorry for the delay our office is working hard to manage our plan for working with the current crisis. Speaking of which, thank you so much for helping me, not sure how things are impacting you, but I appreciate it.

This should link to the mappings: [https://gist.github.com/terrandfw/f4a474644ef5f6df5abba7b4d93e3f9f](https://gist.github.com/terrandfw/f4a474644ef5f6df5abba7b4d93e3f9f)

---

<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:** [March 17, 2020, 12:05pm UTC](https://discuss.elastic.co/t/fielddata-is-disabled-but-i-have-added-a-keyword-field/222353/22 "2020-03-17T12:05:39Z")

</div>

As you can see, inside the `host` object, you have:

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

```

This means that you index does not have recreated or that the index template does not match the index name or that the index template does not have correctly created.

Until the mapping is correct, you need to fix that before moving forward.

My guess here is that you did not drop the existing data and recreate the data.

---

<div class="post-metadata">

**Author:** ![Terran](https://avatars.discourse-cdn.com/v4/letter/t/94ad74/32.png) [@Terran](https://discuss.elastic.co/u/Terran)\
**Post date:** [March 17, 2020, 2:04pm UTC](https://discuss.elastic.co/t/fielddata-is-disabled-but-i-have-added-a-keyword-field/222353/23 "2020-03-17T14:04:38Z")

</div>

I created the template and reindexed everything. I will just blow away my current indices and see what the results are.

---

<div class="post-metadata">

**Author:** ![rameshkr1994](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rameshkr1994/32/59029_2.png) [@rameshkr1994](https://discuss.elastic.co/u/rameshkr1994)\
**Post date:** [March 18, 2020, 9:21am UTC](https://discuss.elastic.co/t/fielddata-is-disabled-but-i-have-added-a-keyword-field/222353/24 "2020-03-18T09:21:41Z")

</div>

Hi @Terran

You need to map your index-

[https://www.elastic.co/guide/en/elasticsearch/reference/current/mapping.html](https://www.elastic.co/guide/en/elasticsearch/reference/current/mapping.html)

Thanks  
HadoopHelp

---

<div class="post-metadata">

**Author:** ![Terran](https://avatars.discourse-cdn.com/v4/letter/t/94ad74/32.png) [@Terran](https://discuss.elastic.co/u/Terran)\
**Post date:** [March 18, 2020, 4:54pm UTC](https://discuss.elastic.co/t/fielddata-is-disabled-but-i-have-added-a-keyword-field/222353/25 "2020-03-18T16:54:48Z")

</div>

I have been trying to do so. I will make another effort and report my results soon. We are still ironing out issues with moving everyone remote so I am tied up pretty solid. Thank you for keeping an eye on this though.

---

<div class="post-metadata">

**Author:** ![Terran](https://avatars.discourse-cdn.com/v4/letter/t/94ad74/32.png) [@Terran](https://discuss.elastic.co/u/Terran)\
**Post date:** [March 23, 2020, 12:19pm UTC](https://discuss.elastic.co/t/fielddata-is-disabled-but-i-have-added-a-keyword-field/222353/26 "2020-03-23T12:19:39Z")

</div>

Here is what I have under the mapping tab inside the template management section in kibana

```auto
    {
  "properties": {
    "host": {
      "properties": {
        "name": {
          "type": "keyword"
        }
      }
    }
  }
}

```

This doesn't seem to map host.name like I think it should, but I don't know why.

---

<div class="post-metadata">

**Author:** ![Terran](https://avatars.discourse-cdn.com/v4/letter/t/94ad74/32.png) [@Terran](https://discuss.elastic.co/u/Terran)\
**Post date:** [March 26, 2020, 2:38pm UTC](https://discuss.elastic.co/t/fielddata-is-disabled-but-i-have-added-a-keyword-field/222353/27 "2020-03-26T14:38:23Z")

</div>

Did I just do this wrong?

---

<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:** [March 26, 2020, 3:09pm UTC](https://discuss.elastic.co/t/fielddata-is-disabled-but-i-have-added-a-keyword-field/222353/28 "2020-03-26T15:09:39Z")

</div>

Probably. But hard to know what you did so there is no way to comment more.

---

<div class="post-metadata">

**Author:** ![Terran](https://avatars.discourse-cdn.com/v4/letter/t/94ad74/32.png) [@Terran](https://discuss.elastic.co/u/Terran)\
**Post date:** [March 26, 2020, 4:49pm UTC](https://discuss.elastic.co/t/fielddata-is-disabled-but-i-have-added-a-keyword-field/222353/29 "2020-03-26T16:49:15Z")

</div>

I could supply the mappings from the index in question, then the above mappings I added via the kibana interface to the template. Is that the best way to do this?

---

<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:** [March 26, 2020, 5:09pm UTC](https://discuss.elastic.co/t/fielddata-is-disabled-but-i-have-added-a-keyword-field/222353/30 "2020-03-26T17:09:20Z")

</div>

It would help to have the exact steps you followed.

---

<div class="post-metadata">

**Author:** ![Terran](https://avatars.discourse-cdn.com/v4/letter/t/94ad74/32.png) [@Terran](https://discuss.elastic.co/u/Terran)\
**Post date:** [March 27, 2020, 4:46pm UTC](https://discuss.elastic.co/t/fielddata-is-disabled-but-i-have-added-a-keyword-field/222353/31 "2020-03-27T16:46:25Z")

</div>

I know my query was malformed. Just not sure how or where. I am still trying to learn as I am new to the platform. I updated the mappings via Kibana UI and after the index rolled over this seemed to resolve the issue.

Thank you so much for sticking with this, but it seems I am in good shape. Just wish I had learned where my query was broken so I don't repeat the issue.

---

<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:** [April 24, 2020, 4:46pm UTC](https://discuss.elastic.co/t/fielddata-is-disabled-but-i-have-added-a-keyword-field/222353/32 "2020-04-24T16:46:26Z")

</div>

Closed on April 24, 2020, 4:46pm UTC

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

[Previous page](https://discuss.elastic.co/t/fielddata-is-disabled-but-i-have-added-a-keyword-field/222353.md?page=1)
