# Template with dynamic mapping and \_all converted in 6.3

**URL:** <https://discuss.elastic.co/t/template-with-dynamic-mapping-and-all-converted-in-6-3/142174>\
**Category:** Elasticsearch\
**Created:** [July 30, 2018, 12:07pm UTC](https://discuss.elastic.co/t/template-with-dynamic-mapping-and-all-converted-in-6-3/142174 "2018-07-30T12:07:57Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![phia](https://avatars.discourse-cdn.com/v4/letter/p/f19dbf/32.png) [@phia](https://discuss.elastic.co/u/phia)\
**Post date:** [July 30, 2018, 12:07pm UTC](https://discuss.elastic.co/t/template-with-dynamic-mapping-and-all-converted-in-6-3/142174/1 "2018-07-30T12:07:57Z")

</div>

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. 😥

Thanks in advance 🙏🏻

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [July 30, 2018, 2:21pm UTC](https://discuss.elastic.co/t/template-with-dynamic-mapping-and-all-converted-in-6-3/142174/2 "2018-07-30T14:21:40Z")

</div>

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`.

---

<div class="post-metadata">

**Author:** ![phia](https://avatars.discourse-cdn.com/v4/letter/p/f19dbf/32.png) [@phia](https://discuss.elastic.co/u/phia)\
**Post date:** [July 31, 2018, 11:22am UTC](https://discuss.elastic.co/t/template-with-dynamic-mapping-and-all-converted-in-6-3/142174/3 "2018-07-31T11:22:59Z")

</div>

Thank you.

I have a problem with the copy\_to. Where do I have to write that? 🤷🏻‍♀️ I already read the instruction but I'm struggeling with that.

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [July 31, 2018, 12:04pm UTC](https://discuss.elastic.co/t/template-with-dynamic-mapping-and-all-converted-in-6-3/142174/4 "2018-07-31T12:04:50Z")

</div>

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

---

<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:** [August 28, 2018, 12:04pm UTC](https://discuss.elastic.co/t/template-with-dynamic-mapping-and-all-converted-in-6-3/142174/5 "2018-08-28T12:04:55Z")

</div>

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