# Elastic Cloud (5.1.2) creating dynamic\_template with 'raw' instead of 'keyword'

**URL:** <https://discuss.elastic.co/t/elastic-cloud-5-1-2-creating-dynamic-template-with-raw-instead-of-keyword/77914>\
**Category:** Elasticsearch\
**Created:** [March 8, 2017, 11:27pm UTC](https://discuss.elastic.co/t/elastic-cloud-5-1-2-creating-dynamic-template-with-raw-instead-of-keyword/77914 "2017-03-08T23:27:12Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![dougbergh](https://avatars.discourse-cdn.com/v4/letter/d/b487fb/32.png) [@dougbergh](https://discuss.elastic.co/u/dougbergh)\
**Post date:** [March 8, 2017, 11:27pm UTC](https://discuss.elastic.co/t/elastic-cloud-5-1-2-creating-dynamic-template-with-raw-instead-of-keyword/77914/1 "2017-03-08T23:27:12Z")

</div>

New to es...  
We use logstash & es for our app logs, with Elastic Cloud providing es. We upgraded to es 5.1.2 recently.  
When new indices are created, they have a dynamic\_template including a "string\_fields" clause that has a "raw" field of type "string".  
I expected new indices to be created with something conforming to [https://www.elastic.co/blog/strings-are-dead-long-live-strings](https://www.elastic.co/blog/strings-are-dead-long-live-strings), i.e.

What I expected:

```
   "dynamic_templates": [
      {
        "string_fields": {
          "match": "*",
          "match_mapping_type": "string",
          "mapping": {
            "fields": {
              "keyword": {
                "type": "keyword"
              }
            },
            "norms": false,
            "type": "text"
          }
        }
      }
    ]

```

What I got:

```
    "dynamic_templates": [
      {
        "string_fields": {
          "match": "*",
          "match_mapping_type": "string",
          "mapping": {
            "fielddata": {
              "format": "disabled"
            },
            "fields": {
              "raw": {
                "ignore_above": 256,
                "index": "not_analyzed",
                "type": "string"
              }
            },
            "index": "analyzed",
            "omit_norms": true,
            "type": "string"
          }
        }
      }
    ],

```

I got the new index with the above dynamic\_template by creating a new index and re-indexing from one of our existing indices (which was created after we upgraded to 5.1.2):

```
PUT logstash-doug_test

```

and then...

```
POST _reindex
{
  "size": 1000,
  "source": {
    "index": "logstash-2017.03"
  },
  "dest": {
    "index": "logstash-doug_test"
  }
}
```

---

<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:** [April 5, 2017, 11:27pm UTC](https://discuss.elastic.co/t/elastic-cloud-5-1-2-creating-dynamic-template-with-raw-instead-of-keyword/77914/2 "2017-04-05T23:27:11Z")

</div>

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