# Fielddata is disabled on text fields by default. Set fielddata=true

**URL:** <https://discuss.elastic.co/t/fielddata-is-disabled-on-text-fields-by-default-set-fielddata-true/193898>\
**Category:** Elasticsearch\
**Created:** [August 5, 2019, 11:31pm UTC](https://discuss.elastic.co/t/fielddata-is-disabled-on-text-fields-by-default-set-fielddata-true/193898 "2019-08-05T23:31:45Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![ntsh999](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ntsh999/32/51172_2.png) [@ntsh999](https://discuss.elastic.co/u/ntsh999)\
**Post date:** [August 5, 2019, 11:31pm UTC](https://discuss.elastic.co/t/fielddata-is-disabled-on-text-fields-by-default-set-fielddata-true/193898/1 "2019-08-05T23:31:45Z")

</div>

I am running elastic stack v 7.2.0 on kubernetes and I am getting this error in the elasticsearch while accessing the metricbeat dashboard

```auto
Caused by: java.lang.IllegalArgumentException: Fielddata is disabled on text fields by default. Set fielddata=true on [host.name] in order to load fielddata in memory by uninverting the inverted index. Note that this can however use significant memory. Alternatively use a keyword field instead.

```

My questions is If I have manually added the template and dashboards, then why am I getting this error? With the template added should not the required mapping go inside the index? I saw some answers which suggested to apply the required mapping. But then In this case how should i give the index name on which this mapping is to be applied as my metricbeat index would be created daily with each new date. I want this explicit mapping to persist across all the metric beat indices formed with each date .  
PUT /what-should-be-the-index-name/\_mapping

---

<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:** [September 2, 2019, 11:31pm UTC](https://discuss.elastic.co/t/fielddata-is-disabled-on-text-fields-by-default-set-fielddata-true/193898/2 "2019-09-02T23:31:47Z")

</div>

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