# Dynamic mapping problems ES 1.3.4

**URL:** <https://discuss.elastic.co/t/dynamic-mapping-problems-es-1-3-4/1522>\
**Category:** Elasticsearch\
**Created:** [May 28, 2015, 10:17pm UTC](https://discuss.elastic.co/t/dynamic-mapping-problems-es-1-3-4/1522 "2015-05-28T22:17:51Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![mkelkar](https://avatars.discourse-cdn.com/v4/letter/m/ea666f/32.png) [@mkelkar](https://discuss.elastic.co/u/mkelkar)\
**Post date:** [May 28, 2015, 10:17pm UTC](https://discuss.elastic.co/t/dynamic-mapping-problems-es-1-3-4/1522/1 "2015-05-28T22:17:51Z")

</div>

Hi All,  
I recently came across a scenario with dynamic mappings. I have an index created with the following mapping:

```
PUT /test/_mapping/entity 
{
    "properties" : {
        "message" : {
            "type" : "string", 
            "store" : false, 
            "index": "not_analyzed"
        },
        "user": {
            "type":"object"
        }
    },
    "dynamic_templates" : [
    {
        "message-lowercase": {
            "path_match": "(\\Quser.message.lc\\E$)",
            "match_pattern": "regex",
            "mapping": {
                "type" : "string", 
                "store" : true, 
                "index": "not_analyzed"
            }
        }
    },
    {
        "message-dynamic": {
            "path_match": "\\Qmessage\\E$",
            "match_pattern": "regex",
            "mapping": {
                "type" : "string", 
                "store" : false, 
                "index": "not_analyzed"
            }
        }
    }
    ]
}

```

Then, I create a document -

```
PUT /test/entity/demo1 
{
    "message": "X",
    "user": {
        "message": "Y",
        "message.lc": "y"
    }
}

```

now if I search like this -

```
GET _search 
{
    "filter": {
        "term": {
           "message.lc": "y"
        } 
    }
}

```

I get 1 hit, which is demo1, which I think should not happen. I am not sure whats wrong with the template...any clues on what I am I missing? I am using ES 1.3.4.

Thanks,  
Madhav.

---

<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:** [July 6, 2017, 12:11am UTC](https://discuss.elastic.co/t/dynamic-mapping-problems-es-1-3-4/1522/2 "2017-07-06T00:11:06Z")

</div>


