# Dynamic Templates Not Applied

**URL:** <https://discuss.elastic.co/t/dynamic-templates-not-applied/125807>\
**Category:** Elasticsearch\
**Created:** [March 27, 2018, 7:59pm UTC](https://discuss.elastic.co/t/dynamic-templates-not-applied/125807 "2018-03-27T19:59:23Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Marty\_Loewenthal](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/marty_loewenthal/32/24409_2.png) [@Marty\_Loewenthal](https://discuss.elastic.co/u/Marty_Loewenthal)\
**Post date:** [March 27, 2018, 7:59pm UTC](https://discuss.elastic.co/t/dynamic-templates-not-applied/125807/1 "2018-03-27T19:59:23Z")

</div>

Hello, a couple questions regarding Dynamic Templates.

1. Can my dynamic template mapping map an object or just simple type properties?  
i.e. I defined this template to map this object each time a property `modules` is encountered.

```auto
"dynamic_templates": [
    {
      "modules-template": {
        "match": "modules",
        "mapping": {
          "properties": {
            "id": {
              "type": "keyword",
              "ignore_above": "1024"
            },
            "minOccurs": {
              "type": "long"
            },
            "maxOccurs": {
              "type": "long"
            },
            "minModules": {
              "type": "long"
            },
            "maxModules": {
              "type": "long"
            },
            "readOnlyFields": {
              "type": "keyword",
              "ignore_above": "1024"
            },
            "isCritical": {
              "type": "boolean"
            }
          }
        }
      }
   }
]

```

Is this possible?  
2. Even if I define each property of the modules object, I can't get mappings to generate with `"dynamic": false`. Is it possible to use dynamic templates while `"dynamic": false` for the index/type?

---

<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 24, 2018, 8:00pm UTC](https://discuss.elastic.co/t/dynamic-templates-not-applied/125807/2 "2018-04-24T20:00:24Z")

</div>

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