# Dynamic templates exception

**URL:** <https://discuss.elastic.co/t/dynamic-templates-exception/148980>\
**Category:** Elasticsearch\
**Created:** [September 18, 2018, 12:38pm UTC](https://discuss.elastic.co/t/dynamic-templates-exception/148980 "2018-09-18T12:38:41Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Antoine1](https://avatars.discourse-cdn.com/v4/letter/a/73ab20/32.png) [@Antoine1](https://discuss.elastic.co/u/Antoine1)\
**Post date:** [September 18, 2018, 12:38pm UTC](https://discuss.elastic.co/t/dynamic-templates-exception/148980/1 "2018-09-18T12:38:42Z")

</div>

Hello,

I am updating the version 1.7 to 5.0 of ElasticSearch.

I have the following exception concerning a json mapping :

MapperParsingException[Failed to parse mapping [service]: Mapping definition for [prices] has unsupported parameters: [dynamic\_templates : [{prices={mapping={type=integer}, match\_mapping\_type=text}}]]]; nested: MapperParsingException[Mapping definition for [prices] has unsupported parameters: [dynamic\_templates : [{prices={mapping={type=integer}, match\_mapping\_type=text}}]]];

// my json code

```
 {
    "service" : {
        "dynamic": "false",
        "_source": {
            "excludes": [
                "facets",
                "filters",
                "searchText",
                "pubSearchText",
                "sort"
            ]
        },
        "properties": {
            "category": { "type": "integer" },
            "brand": { "type": "text", "index": "not_analyzed" },
            "facets": { "type": "text", "index": "not_analyzed" },
            "filters": { "type": "keyword", "index": "not_analyzed" },
            "searchText": { "type": "text", "index": "analyzed", "search_analyzer" : "analyzer", "analyzer" : "index_analyzer"},
            "pubSearchText": { "type": "text", "index": "analyzed", "analyzer": "folding" },
            "reference": { "type": "text", "index": "analyzed", "analyzer": "folding" },
            "brandName": { "type": "text", "index": "analyzed", "analyzer": "folding" },
            "categoryName": { "type": "text", "index": "analyzed", "analyzer": "folding" },
            "sort" : {
                "properties": {
                    "prices": {
                        "dynamic": "true",
                        "type": "object",
                        "dynamic_templates": [{
                            "prices" : {
                                "match" : "*",
                                "mapping" : { "type" : "integer" }
                            }
                        }]
                    },
                    "px12": { "type": "integer" },
                    "px24": { "type": "integer" },
                    "pxSe": { "type": "integer" },
                    "publishedDate": { "type": "long" },
                    "salesLevel": { "type": "integer" },
                    "dartyComSort": { "type": "integer" }
                }
            }
        }
		
    }
}

```

I think "dynamic\_templates" is misplaced.

Please help me 🙂

Thank you very much.

---

<div class="post-metadata">

**Author:** ![rjernst](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rjernst/32/6363_2.png) [@rjernst](https://discuss.elastic.co/u/rjernst)\
**Post date:** [September 19, 2018, 7:15pm UTC](https://discuss.elastic.co/t/dynamic-templates-exception/148980/2 "2018-09-19T19:15:25Z")

</div>

`dynamic_templates` are a top level feature of mappings. they need to be at the same level as the root `dynamic` setting. See [https://www.elastic.co/guide/en/elasticsearch/reference/current/dynamic-templates.html](https://www.elastic.co/guide/en/elasticsearch/reference/current/dynamic-templates.html)

---

<div class="post-metadata">

**Author:** ![Antoine1](https://avatars.discourse-cdn.com/v4/letter/a/73ab20/32.png) [@Antoine1](https://discuss.elastic.co/u/Antoine1)\
**Post date:** [September 24, 2018, 12:40pm UTC](https://discuss.elastic.co/t/dynamic-templates-exception/148980/3 "2018-09-24T12:40:50Z")

</div>

Ok thanks.

---

<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:** [October 22, 2018, 12:40pm UTC](https://discuss.elastic.co/t/dynamic-templates-exception/148980/4 "2018-10-22T12:40:52Z")

</div>

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