# How to adapt dynamic template?

**URL:** <https://discuss.elastic.co/t/how-to-adapt-dynamic-template/82720>\
**Category:** Elasticsearch\
**Created:** [April 18, 2017, 1:38pm UTC](https://discuss.elastic.co/t/how-to-adapt-dynamic-template/82720 "2017-04-18T13:38:51Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Beuhlet\_Reseau](https://avatars.discourse-cdn.com/v4/letter/b/e95f7d/32.png) [@Beuhlet\_Reseau](https://discuss.elastic.co/u/Beuhlet_Reseau)\
**Post date:** [April 18, 2017, 1:38pm UTC](https://discuss.elastic.co/t/how-to-adapt-dynamic-template/82720/1 "2017-04-18T13:38:51Z")

</div>

Hello,

I have few interrogations about dynamic template in elasticsearch.

**I don't need analyze text**. (I believe i don't need analyze numeric field too ?).

Here my currently template, for the moment it's not analyze just keywords fields :

```
  {
    "order": 0,
    "version": 50001,
    "template": "edr-*",
    "settings": {
      "index": {
        "number_of_shards": "1",
        "number_of_replicas": "0",
        "refresh_interval": "-1"
      }
    },
    "mappings": {
      "_default_": {
        "dynamic_templates": [
          {
            "string_fields": {
              "mapping": {
                "norms": false,
                "type": "text",
                "fields": {
                  "keyword": {
                    "index": "not_analyzed",
                    "type": "keyword"
                  }
                }
              },
              "match_mapping_type": "string",
              "match": "*"
            }
          }
        ],
        "_all": {
          "norms": false,
          "enabled": true
        },
        "properties": {
          "edr_GrantedTotalOctets": {
            "type": "long"
          },
          "edr_MSN": {
            "type": "long"
          },
          "edr_Useets": {
            "type": "long"
          },
          "geoip": {
            "enabled": false
          },
          "edr_MionFlag": {
            "type": "byte"
          },
          "input_type": {
            "enabled": false
          },
          "edr_Usamit": {
            "type": "long"
          },
          "edr_Janomer": {
            "type": "byte"
          },
          "@timestamp": {
            "include_in_all": false,
            "type": "date"
          },
          "edr_Subscrid": {
            "type": "long"
          },
          "beat": {
            "enabled": false
          },
          "@version": {
            "include_in_all": false,
            "type": "keyword"
          },
          "name": {
            "enabled": false
          },
          "host": {
            "enabled": false
          },
          "edr_MastDN": {
            "index": "not_analyzed",
            "type": "long"
          },
          "edr_ParolFlag": {
            "type": "byte"
          },
          "edr_NC": {
            "type": "integer"
          },
          "edr_II": {
            "type": "long"
          }
        }
      }
    },
    "aliases": {}

```

In elasticsearch deprecated logs, **i have error messages about deprecated string fields.** How to resolve it ?

In my index pattern page, i have .keyword not analyze (ok), but not mains fields (exemple : edr\_CCRT : analyzed ; edr\_CCRT : not analyze).

 ![](https://us1.discourse-cdn.com/elastic/original/3X/f/b/fb7033c3c1a3b66e1d874ac2787291ccb16f318b.JPG)

I think it's better to put "not\_analyze" to all field (string, text, numeric) no ? But how 😕

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [April 18, 2017, 10:15pm UTC](https://discuss.elastic.co/t/how-to-adapt-dynamic-template/82720/2 "2017-04-18T22:15:31Z")

</div>

If you are using 5.X it's keyword, not a not analysed string.

---

<div class="post-metadata">

**Author:** ![Beuhlet\_Reseau](https://avatars.discourse-cdn.com/v4/letter/b/e95f7d/32.png) [@Beuhlet\_Reseau](https://discuss.elastic.co/u/Beuhlet_Reseau)\
**Post date:** [April 19, 2017, 8:51am UTC](https://discuss.elastic.co/t/how-to-adapt-dynamic-template/82720/3 "2017-04-19T08:51:46Z")

</div>

Yes i use 5.x.

I don't understand your response @warkolm I know string fields are deprecated but string type appears in kibana index pattern page...

I want not analyze all fields. Because i don't use token to my search. I don't want TEST,CUSTO,DATA but TEST\_CUSTO\_DATA, i don't use 1,345,344,456 but 1345344456 . You see what i talk ?

I'm ok to not use string 🙂

---

<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:** [May 17, 2017, 8:56am UTC](https://discuss.elastic.co/t/how-to-adapt-dynamic-template/82720/4 "2017-05-17T08:56:44Z")

</div>

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