# Issue with index - set fielddata=true

**URL:** <https://discuss.elastic.co/t/issue-with-index-set-fielddata-true/295594>\
**Category:** Kibana\
**Created:** [January 27, 2022, 3:22pm UTC](https://discuss.elastic.co/t/issue-with-index-set-fielddata-true/295594 "2022-01-27T15:22:31Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Penchev](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/penchev/32/100328_2.png) [@Penchev](https://discuss.elastic.co/u/Penchev)\
**Post date:** [January 27, 2022, 3:22pm UTC](https://discuss.elastic.co/t/issue-with-index-set-fielddata-true/295594/1 "2022-01-27T15:22:31Z")

</div>

Hello,

When working with my dashboards I got this error message:

` "Text fields are not optimised for operations that require per-document field data like aggregations and sorting, so these operations are disabled by default. Please use a keyword field instead. Alternatively, set fielddata=true on [rule.id] in order to load field data by uninverting the inverted index. Note that this can use significant memory."`

I try to update that field with:

PUT my-index/\_mapping

```auto
{
  "properties": {
    "rule.id": { 
      "type": "keyword",
      "fielddata": true
    }
  }
}

```

I got as a result:

```auto
{
  "error" : {
    "root_cause" : [
      {
        "type" : "mapper_parsing_exception",
        "reason" : "unknown parameter [fielddata] on mapper [id] of type [keyword]"
      }
    ],
    "type" : "mapper_parsing_exception",
    "reason" : "Failed to parse mapping [_doc]: unknown parameter [fielddata] on mapper [id] of type [keyword]",
    "caused_by" : {
      "type" : "mapper_parsing_exception",
      "reason" : "unknown parameter [fielddata] on mapper [id] of type [keyword]"
    }
  },
  "status" : 400
}

```

I checked and this field's type is text, keyword.  
Is that the reason I cannot update the fielddate to true?  
Any ideas how to solve that?

Regards,  
P

---

<div class="post-metadata">

**Author:** ![Tomo\_M](https://avatars.discourse-cdn.com/v4/letter/t/848f3c/32.png) [@Tomo\_M](https://discuss.elastic.co/u/Tomo_M)\
**Post date:** [January 27, 2022, 4:05pm UTC](https://discuss.elastic.co/t/issue-with-index-set-fielddata-true/295594/2 "2022-01-27T16:05:40Z")

</div>

2 points.

1. You can't change existing mappings (possibly {"rule.id": {"type": "text"}}).
2. {"fielddata": true} is a parapeter for only text field.

Please try,

```auto
PUT my-index/_mapping
{
  "properties": {
    "rule.id": { 
      "type": "text",
      "fielddata": true
    }
  }
}

```

---

<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:** [February 24, 2022, 4:06pm UTC](https://discuss.elastic.co/t/issue-with-index-set-fielddata-true/295594/3 "2022-02-24T16:06:24Z")

</div>

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