# Kibana error "fielddata is disabled by default on text fields"

**URL:** <https://discuss.elastic.co/t/kibana-error-fielddata-is-disabled-by-default-on-text-fields/57615>\
**Category:** Elasticsearch\
**Created:** [August 9, 2016, 4:22pm UTC](https://discuss.elastic.co/t/kibana-error-fielddata-is-disabled-by-default-on-text-fields/57615 "2016-08-09T16:22:36Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![marminthibaut](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/marminthibaut/32/8509_2.png) [@marminthibaut](https://discuss.elastic.co/u/marminthibaut)\
**Post date:** [August 9, 2016, 4:22pm UTC](https://discuss.elastic.co/t/kibana-error-fielddata-is-disabled-by-default-on-text-fields/57615/1 "2016-08-09T16:22:36Z")

</div>

Hi,

Kibana gives me an error when I try to render a vizualisation : Visualize: Fielddata is disabled on text fields by default. Set fielddata=true on [bytes] in order to load fielddata in memory by bla bla bla...

The problem is: the field "bytes" is a long, not a text field. When I try to create a visualization with an sum of bytes as metric, this field is not visible in the select.

I pushed my mapping template, containing:

```auto
{
  "mappings": {
    "_default_": {
      "_all": {
        "enabled": true,
        "norms": {
          "enabled": false
        }
      },
      "dynamic_templates": [
        {
          "template1": {
            "mapping": {
              "doc_values": true,
              "ignore_above": 1024,
              "index": "not_analyzed",
              "type": "{dynamic_type}"
            },
            "match": "*"
          }
        }
      ],
      "properties": {
        "@timestamp": {
          "type": "date"
        },
        "message": {
          "type": "string",
          "index": "analyzed"
        },
        "offset": {
          "type": "long",
          "doc_values": "true"
        },
		"referrer": {
          "type": "string",
          "index": "analyzed"
        },
		"agent": {
          "type": "string",
          "index": "analyzed"
        },
		"clientip": {
          "type": "ip"
        },
		"ident": {
          "type": "string",
          "index": "analyzed"
        },
		"auth": {
          "type": "string",
          "index": "analyzed"
        },
		"referrer": {
          "type": "string",
          "index": "analyzed"
        },
		"verb": {
          "type": "string",
          "index": "analyzed"
        },
		"referrer": {
          "type": "string",
          "index": "analyzed"
        },
		"request": {
          "type": "string",
          "index": "analyzed"
        },
		"httpversion": {
          "type": "float",
          "doc_values": "true"
        },
		"response": {
          "type": "long",
          "doc_values": "true"
        },
		"bytes": {
          "type": "long",
          "doc_values": "true"
        },
		"class": {
          "type": "string",
          "index": "analyzed"
        },
		"request": {
          "type": "string",
          "index": "analyzed"
        },
		"request": {
          "type": "level",
          "index": "analyzed"
        },
		"content": {
          "type": "string",
          "index": "analyzed"
        },
		"errNumber": {
          "type": "long",
          "doc_values": "true"
        },
		"session": {
          "type": "string",
          "index": "analyzed"
        }
      }
    }
  },
  "settings": {
    "index.refresh_interval": "5s"
  },
  "template": "indice-*"
}

```

Weird problem: kibana shows a **string** (analyzed and indexed) for this fields (into settings / template fields).

My software versions are:

- elasticsearch 5 alpha 3
- kibana 5 alpha 3

My stack is **filebeat** alpha 4 -\> **redis** -\> **logstash** alpha 4 -\> **elasticsearch** alpha 3.

Any idea?

Thanks

---

<div class="post-metadata">

**Author:** ![jpountz](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jpountz/32/45836_2.png) [@jpountz](https://discuss.elastic.co/u/jpountz)\
**Post date:** [August 9, 2016, 9:20pm UTC](https://discuss.elastic.co/t/kibana-error-fielddata-is-disabled-by-default-on-text-fields/57615/2 "2016-08-09T21:20:14Z")

</div>

Can you check the mappings of the `bytes` field on all indices in the cluster?

---

<div class="post-metadata">

**Author:** ![marminthibaut](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/marminthibaut/32/8509_2.png) [@marminthibaut](https://discuss.elastic.co/u/marminthibaut)\
**Post date:** [August 12, 2016, 8:17am UTC](https://discuss.elastic.co/t/kibana-error-fielddata-is-disabled-by-default-on-text-fields/57615/3 "2016-08-12T08:17:44Z")

</div>

Here is an extract of the mapping of the bytes field on one indice:

```auto
bytes: {
  type: "text",
  fields: {
    keywork: {
      type: "keyword",
      ignore_above: 256
    }
  }
}

```

I don't understand why my template mapping is not applied...

Here is the full mapping: [http://pastebin.com/Hi66Vsm3](http://pastebin.com/Hi66Vsm3)

---

<div class="post-metadata">

**Author:** ![marminthibaut](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/marminthibaut/32/8509_2.png) [@marminthibaut](https://discuss.elastic.co/u/marminthibaut)\
**Post date:** [August 12, 2016, 7:57pm UTC](https://discuss.elastic.co/t/kibana-error-fielddata-is-disabled-by-default-on-text-fields/57615/4 "2016-08-12T19:57:50Z")

</div>

Problem solved...

I just based my template on the [filebeat/template-es2x.json](https://github.com/elastic/beats/blob/master/filebeat/filebeat.template-es2x.json) file 🙂

---

<div class="post-metadata">

**Author:** ![small-tomorrow](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/small-tomorrow/32/13319_2.png) [@small-tomorrow](https://discuss.elastic.co/u/small-tomorrow)\
**Post date:** [November 15, 2016, 12:25pm UTC](https://discuss.elastic.co/t/kibana-error-fielddata-is-disabled-by-default-on-text-fields/57615/5 "2016-11-15T12:25:05Z")

</div>

Hi , @jpountz @marminthibaut @zikakou1er @fcza  
**I run into the same problem now , here is part of my template :**  
"short\_name": {  
"index": "not\_analyzed",  
"type": "keyword",  
"doc\_values": true  
},  
"country\_id": {  
"index": "not\_analyzed",  
"type": "string",  
"doc\_values": true  
},  
"city\_id": {  
"type": "integer",  
"doc\_values": true  
}

**and I got error when I upgrade ES from V 2.1 to V 5.0.0 , how can I solve this problem considering I have so much data with V 2.1:**  
**error MSG :**  
"reason": {  
"type": "illegal\_argument\_exception",  
"reason": "Fielddata is disabled on text fields by default. Set fielddata=true on [short\_name] in order to load fielddata in memory by uninverting the inverted index. Note that this can however use significant memory."  
}

---

<div class="post-metadata">

**Author:** ![rootameen](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rootameen/32/14470_2.png) [@rootameen](https://discuss.elastic.co/u/rootameen)\
**Post date:** [January 17, 2017, 6:46am UTC](https://discuss.elastic.co/t/kibana-error-fielddata-is-disabled-by-default-on-text-fields/57615/6 "2017-01-17T06:46:41Z")

</div>

Have you found a solution? I'm having the same with normal filebeat.

---

<div class="post-metadata">

**Author:** ![Creative\_Toy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/creative_toy/32/15407_2.png) [@Creative\_Toy](https://discuss.elastic.co/u/Creative_Toy)\
**Post date:** [February 21, 2017, 4:00am UTC](https://discuss.elastic.co/t/kibana-error-fielddata-is-disabled-by-default-on-text-fields/57615/7 "2017-02-21T04:00:58Z")

</div>

How to set filedata = true to fix this error?

---

<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:** [July 5, 2017, 10:03pm UTC](https://discuss.elastic.co/t/kibana-error-fielddata-is-disabled-by-default-on-text-fields/57615/8 "2017-07-05T22:03:03Z")

</div>


