Remove ignore_above default mapping

Hello,

So I have defined a mapping for an index before loading the data. So based on that (I guess), any new text fields coming are considered as text/keyword fields but with additional property of ignore_above:256. How to disable the dynamic assignment of ignore_above:256?

Any help is appreciated.

Thanks.

You'd need to do something like this at index creation time:

PUT my_index
{
  "mappings": {
    "my_type": {
      "dynamic_templates": [
        {
          "strings": {
            "match_mapping_type": "string",
            "mapping": {
              "type": "text",
              "fields": {
                "keyword": {
                  "type":  "keyword"
                }
              }
            }
          }
        }
      ]
    }
  }
}

This will give Elasticsearch a new dynamic template for strings which will override the default one.

1 Like

That seems to work. Thank you so much :smile:

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