# Fielddata is disabled on text fields by default

**URL:** <https://discuss.elastic.co/t/fielddata-is-disabled-on-text-fields-by-default/204813>\
**Category:** Elasticsearch\
**Created:** [October 23, 2019, 7:54am UTC](https://discuss.elastic.co/t/fielddata-is-disabled-on-text-fields-by-default/204813 "2019-10-23T07:54:13Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![BeMoore](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/bemoore/32/58724_2.png) [@BeMoore](https://discuss.elastic.co/u/BeMoore)\
**Post date:** [October 23, 2019, 7:54am UTC](https://discuss.elastic.co/t/fielddata-is-disabled-on-text-fields-by-default/204813/1 "2019-10-23T07:54:13Z")

</div>

So consider the following:

> Fielddata is disabled on text fields by default. Set `fielddata=true` on  
> [`your_field_name`] in order to load fielddata in memory by uninverting the  
> inverted index. Note that this can however use significant memory.

 ![Capture](https://us1.discourse-cdn.com/elastic/original/3X/f/9/f9e8f5d47a87e7715b2a3e031e6b5a83eee85b84.jpeg)

reading [https://www.elastic.co/guide/en/elasticsearch/reference/current/fielddata.html#fielddata](https://www.elastic.co/guide/en/elasticsearch/reference/current/fielddata.html#fielddata) tells me there's some alterations that need to be made to the fielddata(text) in order for the documents to be searchable on a specific term.

Issue i can't get my head around is, if i have multiple indexes and multiple " Fielddata is disabled on text fields by default" issues on a variety of fields, how can i get this resolved going forward?

Do i have to use something like this:

> PUT your\_index/\_mapping/your\_type  
> {  
> "your\_type": {  
> "properties": {  
> "publisher": {  
> "type": "text",  
> "fielddata": true  
> }  
> }  
> }  
> }

on every affected field? in every index in every mapping?

is there not a way of affecting this change wholesale? i mean, if it means i have to wipe out my indexes and start again make the change and going forward the issue is resolved, thats fine, or can i make a change and make it effective on existing indexes ?

and how will this affect heap usage, i read that switching this on to get around this error uses a lot of heap space, so making this change seems counter to efficient use.

---

<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:** [October 23, 2019, 8:05am UTC](https://discuss.elastic.co/t/fielddata-is-disabled-on-text-fields-by-default/204813/2 "2019-10-23T08:05:57Z")

</div>

You should use the keyword data type instead.

---

<div class="post-metadata">

**Author:** ![BeMoore](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/bemoore/32/58724_2.png) [@BeMoore](https://discuss.elastic.co/u/BeMoore)\
**Post date:** [October 23, 2019, 8:08am UTC](https://discuss.elastic.co/t/fielddata-is-disabled-on-text-fields-by-default/204813/3 "2019-10-23T08:08:20Z")

</div>

is that something i can use wholesale like

> PUT o365beat\*/\_mapping/_your\_type_  
> {  
> "your\_type": {  
> "properties": {  
> "publisher": {  
> "type": "data",  
> "fielddata": true  
> }  
> }  
> }  
> }

and what value would _your\_type_ be ?

---

<div class="post-metadata">

**Author:** ![BeMoore](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/bemoore/32/58724_2.png) [@BeMoore](https://discuss.elastic.co/u/BeMoore)\
**Post date:** [October 23, 2019, 8:13am UTC](https://discuss.elastic.co/t/fielddata-is-disabled-on-text-fields-by-default/204813/4 "2019-10-23T08:13:29Z")

</div>

ahhhh ok.. i don't have a dedicated template for this data... does this mean i could affect a change by using a dedicated template for this index type ? my o365beat input, i could use a template to make these multiple field types from text to data?

---

<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:** [October 23, 2019, 8:58am UTC](https://discuss.elastic.co/t/fielddata-is-disabled-on-text-fields-by-default/204813/5 "2019-10-23T08:58:41Z")

</div>

Yes. You will have to drop the index and reindex though.

---

<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:** [November 20, 2019, 9:08am UTC](https://discuss.elastic.co/t/fielddata-is-disabled-on-text-fields-by-default/204813/6 "2019-11-20T09:08:42Z")

</div>

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