# Mapping not respected

**URL:** <https://discuss.elastic.co/t/mapping-not-respected/249670>\
**Category:** Elasticsearch\
**Created:** [September 23, 2020, 1:59pm UTC](https://discuss.elastic.co/t/mapping-not-respected/249670 "2020-09-23T13:59:49Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Tuckson](https://avatars.discourse-cdn.com/v4/letter/t/f14d63/32.png) [@Tuckson](https://discuss.elastic.co/u/Tuckson)\
**Post date:** [September 23, 2020, 1:59pm UTC](https://discuss.elastic.co/t/mapping-not-respected/249670/1 "2020-09-23T13:59:50Z")

</div>

Hi,

In Elastic 7.9.1I have this template (which is considered 'legacy' for some reason) which has several mappings like for example this one:  
 ![image](https://us1.discourse-cdn.com/elastic/original/3X/2/a/2a131e625ad32bca53c276851392da30ada0e0b1.png)

However, when I look at the actual index I see everything is mapped as text.

```auto
        "app-id": {
          "type": "text",
          "fields": {
            "keyword": {
              "type": "keyword",
              "ignore_above": 256
            }
          }
        },
        "client-ip": {
          "type": "text",
          "fields": {
            "keyword": {
              "type": "keyword",
              "ignore_above": 256
            }
          }
        },
        "ecs": {
          "properties": {
            "version": {
              "type": "text",
              "fields": {
                "keyword": {
                  "type": "keyword",
                  "ignore_above": 256
                }
              }
            }
          }
        },
        "event-type": {
          "type": "text",
          "fields": {
            "keyword": {
              "type": "keyword",
              "ignore_above": 256
            }
          }
        },
        "execution-time": {
          "type": "text",
          "fields": {
            "keyword": {
              "type": "keyword",
              "ignore_above": 256
            }
          }
        },

```

What may cause this?

---

<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:** [September 23, 2020, 9:45pm UTC](https://discuss.elastic.co/t/mapping-not-respected/249670/2 "2020-09-23T21:45:01Z")

</div>

Is the screenshot of the template, or the applied mapping?

---

<div class="post-metadata">

**Author:** ![Tuckson](https://avatars.discourse-cdn.com/v4/letter/t/f14d63/32.png) [@Tuckson](https://discuss.elastic.co/u/Tuckson)\
**Post date:** [September 24, 2020, 10:03am UTC](https://discuss.elastic.co/t/mapping-not-respected/249670/3 "2020-09-24T10:03:23Z")

</div>

Template.  
Here screenshot of what it says in json for that execution-time field

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/1/7/172a6aaddd83561a7c2eefbbcb257b2ac5320a0e.png)

I now tried to switch off dynamic mapping and this does the trick.  
So with dynamic mapping on in the template, my own mappings are overruled?

---

<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:** [September 28, 2020, 1:22am UTC](https://discuss.elastic.co/t/mapping-not-respected/249670/4 "2020-09-28T01:22:23Z")

</div>

> [@Tuckson](#):
>
> So with dynamic mapping on in the template, my own mappings are overruled?

Templates take priority over dynamic mapping.

---

<div class="post-metadata">

**Author:** ![Tuckson](https://avatars.discourse-cdn.com/v4/letter/t/f14d63/32.png) [@Tuckson](https://discuss.elastic.co/u/Tuckson)\
**Post date:** [September 28, 2020, 9:55am UTC](https://discuss.elastic.co/t/mapping-not-respected/249670/5 "2020-09-28T09:55:35Z")

</div>

Well, not with me. After disabling dynamic mapping the mapping in the templates is applied.

---

<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 26, 2020, 9:55am UTC](https://discuss.elastic.co/t/mapping-not-respected/249670/6 "2020-10-26T09:55:35Z")

</div>

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