Template with dynamic mapping and _all converted in 6.3

Hey guys,

I currently have a JSON for creating a template. There are so many changes in Elasticsearch 6.x so that I am not able to convert my JSON. Can you please help me?
Current JSON:

{
  "template" : "ws*", 
  "settings": { 
    "index.refresh_interval": "1s", "number_of_shards": 5
  },
  "mappings": {
    "_default_": {
      "_all": { "enabled": true, "analyzer": "english"},
      "dynamic_templates": [ {
        "string_fields": {
          "match": "*",
          "match_mapping_type": "string",
          "mapping": {
            "type": "string", "index": "analyzed",
            "fields": {
              "raw": { "type": "string", "index": "not analyzed", "ignore_above": 256}
            }
         }
      }],
    "properties": {
      "@version": { "type": "string, "index": "not_analyzed" },
      "@timestamp": { "type": "date},
      "field": { "type": "integer}
     }
   }
  }
}

I know that _all and the string type are deprecated in the 6.x version. I absolutely need help to convert it. :disappointed_relieved:

Thanks in advance :pray:t2:

I'd remove _all field and use copy_to feature instead.
I'd replace string by text.
And for non analyzed fields, I'd use keyword.

Thank you.

I have a problem with the copy_to. Where do I have to write that? :woman_shrugging:t2: I already read the instruction but I'm struggeling with that.

Example here: https://www.elastic.co/guide/en/elasticsearch/reference/current/copy-to.html

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