How to set default mapping to “keyword” for dynamically added properties in Elasticsearch

In our application we add new documents which can have new unknown properties.

Is it possible to set default mapping to "keyword" for dynamically added new properties in Elasticsearch?

@gitterhh
You can do this by defining dynamic template

{
  "mappings": {
    "dynamic_templates": [
      {
        "strings": {
          "match_mapping_type": "string",
          "mapping": {
            "type": "keyword"
          }
        }
      }
    ]
  }
}

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