Elasticsearch fields

Is there a default setting in E5.5 that will set any newly created doc fields as not-analyzed / keyword by default?

Hi @baiesi,

You can dynamic templates for that. Here an example where all fields of type string will receive a custom mapping:

PUT index_name
{
  "mappings": {
    "my_type": {
      "dynamic_templates": [
        {
          "strings": {
            "match_mapping_type": "string",
            "mapping": {
              "type": "text",
              "fields": {
                "raw": {
                  "type":  "keyword",
                  "ignore_above": 256
                }
              }
            }
          }
        }
      ]
    }
  }
} 

Best.
LG

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