# 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

**URL:** <https://discuss.elastic.co/t/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/176727>\
**Category:** Beats\
**Tags:** metricbeat\
**Created:** [April 13, 2019, 9:40am UTC](https://discuss.elastic.co/t/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/176727 "2019-04-13T09:40:17Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Zyuxing](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/zyuxing/32/44143_2.png) [@Zyuxing](https://discuss.elastic.co/u/Zyuxing)\
**Post date:** [April 13, 2019, 9:40am UTC](https://discuss.elastic.co/t/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/176727/1 "2019-04-13T09:40:17Z")

</div>

I had this problem visiting kibana Infrastructure.  
I followed the document example:  
PUT metricbeat - \* / \_mapping  
{  
"Properties" : {  
"Host name" : {  
"Type" : "text",  
"Fielddata" : true  
}  
}  
}  
It happened:  
Mapper [host.name] of different types, current\_type [keyword], merged\_type [text]  
How can I solve this problem

---

<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:** [April 13, 2019, 9:54am UTC](https://discuss.elastic.co/t/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/176727/2 "2019-04-13T09:54:33Z")

</div>

You can't change the mapping for an existing field.  
You need to drop the index for that and then create the mapping.

BTW, why do you want to use `fielddata` instead of using the `keyword` datatype?

---

<div class="post-metadata">

**Author:** ![Zyuxing](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/zyuxing/32/44143_2.png) [@Zyuxing](https://discuss.elastic.co/u/Zyuxing)\
**Post date:** [April 13, 2019, 10:25am UTC](https://discuss.elastic.co/t/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/176727/3 "2019-04-13T10:25:30Z")

</div>

The metricbeat-\* index is the automatically produced index of metricbeat.  
Before I created geoip using logstash, I could use metricbeat to access Infrastructure on kibana to view the data visualization, but after I used geoip I couldn't access the Infrastructure visualization graph, which shows the problems with Fielddata

---

<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:** [April 13, 2019, 10:44am UTC](https://discuss.elastic.co/t/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/176727/4 "2019-04-13T10:44:34Z")

</div>

If you need to change something, you need to change the index template for the indices that will be created after.

I'm unsure I understood your exact problem with `fielddata` though and how this relates to `geoip`... Some examples, logs, error messages would help.  
But I think it's better to move this thread to #beats:metricbeat. So I just did that.

---

<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:** [May 11, 2019, 10:44am UTC](https://discuss.elastic.co/t/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/176727/5 "2019-05-11T10:44:36Z")

</div>

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