# Not\_analyzed mapping not applied

**URL:** <https://discuss.elastic.co/t/not-analyzed-mapping-not-applied/57155>\
**Category:** Elasticsearch\
**Created:** [August 3, 2016, 9:44pm UTC](https://discuss.elastic.co/t/not-analyzed-mapping-not-applied/57155 "2016-08-03T21:44:45Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![stecino](https://avatars.discourse-cdn.com/v4/letter/s/ea666f/32.png) [@stecino](https://discuss.elastic.co/u/stecino)\
**Post date:** [August 3, 2016, 9:44pm UTC](https://discuss.elastic.co/t/not-analyzed-mapping-not-applied/57155/1 "2016-08-03T21:44:45Z")

</div>

Hello,

I have a mapping template here is the snippet:

```
 "mappings": {
        "_default_": {
            "dynamic_templates": [
               {
                    "string": {
                        "match": "request",
                        "mapping": {
                            "index": "not_analyzed",
                            "type": "string"
                        }
                    }
                },
               {
                    "string": {
                        "match": "http_x_forwarded_for*",
                        "mapping": {
                            "index": "not_analyzed",
                            "type": "string"
                        }
                    }
                },

```

when I query mapping for my index that this mapping template applies to, I get the following

{  
"my\_index" : {  
"mappings" : {  
"_default_" : {  
"dynamic\_templates" : [ {  
"string" : {  
"mapping" : {  
"index" : "not\_analyzed",  
"type" : "string"  
},  
"match" : "request"  
}  
}, {  
"string" : {  
"mapping" : {  
"index" : "not\_analyzed",  
"type" : "string"  
},  
"match" : "http\_x\_forwarded\_for\*"  
}  
},

......

```
  "nginx" : {
    "dynamic_templates" : [ {
      "string" : {
        "mapping" : {
          "index" : "not_analyzed",
          "type" : "string"
        },
        "match" : "request"
      }
    }, {
      "string" : {
        "mapping" : {
          "index" : "not_analyzed",
          "type" : "string"
        },
        "match" : "http_x_forwarded_for*"
      }
    },

```

......

```
    "properties" : {
      "@timestamp" : {
        "type" : "date",
        "format" : "strict_date_optional_time||epoch_millis"
      },
      "@version" : {
        "type" : "string"
      },
      "http_x_forwarded_for" : {
        "type" : "string",
        "index" : "not_analyzed"
      },

      "http_x_forwarded_for1" : {
        "type" : "string"
      },
      "http_x_forwarded_for2" : {
        "type" : "string"
      },
      "request" : {
        "type" : "string"
      },

```

shouldn't I have all fields that match http\_x\_forwarded\_for be not\_analyzed and why request not set to not\_analyzed in the properties section.

---

<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 5, 2017, 10:30pm UTC](https://discuss.elastic.co/t/not-analyzed-mapping-not-applied/57155/2 "2017-07-05T22:30:17Z")

</div>


