# Removing subfield in concrete mapping

**URL:** <https://discuss.elastic.co/t/removing-subfield-in-concrete-mapping/22412>\
**Category:** Elasticsearch\
**Created:** [February 26, 2015, 3:57pm UTC](https://discuss.elastic.co/t/removing-subfield-in-concrete-mapping/22412 "2015-02-26T15:57:20Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![magnusbaeck](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/magnusbaeck/32/44943_2.png) [@magnusbaeck](https://discuss.elastic.co/u/magnusbaeck)\
**Post date:** [February 26, 2015, 3:57pm UTC](https://discuss.elastic.co/t/removing-subfield-in-concrete-mapping/22412/1 "2015-02-26T15:57:20Z")

</div>

I'm using the following index template (derived from the Logstash index  
template):

```
{
  "template": "logstash-*",
  ...
  "mappings": {
    "_default_": {
      ...
      "dynamic_templates": [
        {
          "string_fields": {
            "match": "*",
            "match_mapping_type": "string",
            "mapping": {
              "type": "string",
              "index": "analyzed",
              "omit_norms": true,
              "fields": {
                "raw": {
                  "type": "string",
                  "index": "not_analyzed",
                  "ignore_above": 256
                }
              }
            }
          }
        }
      ]
    },
    "gerrit_event": {
      "dynamic_templates": [
        {
          "string_fields": {
            "match": "*",
            "match_mapping_type": "string",
            "mapping": {
              "type": "string",
              "index": "not_analyzed",
              "omit_norms": true,
              "fields": {}
            }
          }
        }
      ]
    }
  }
  ...
}

```

I thought this would've effectively deleted the .raw subfield for  
gerrit\_event documents, but that doesn't happen:

$ curl --silent -XGET '[http://localhost:9200/logstash-2015.04.25/\_mapping/gerrit\_event?pretty](http://localhost:9200/logstash-2015.04.25/_mapping/gerrit_event?pretty)' | head -n 22  
{  
"logstash-2015.04.25" : {  
"mappings" : {  
"gerrit\_event" : {  
"dynamic\_templates" : [ {  
"string\_fields" : {  
"mapping" : {  
"index" : "not\_analyzed",  
"type" : "string",  
"fields" : {  
"raw" : {  
"index" : "not\_analyzed",  
"ignore\_above" : 256,  
"type" : "string"  
}  
},  
"omit\_norms" : true  
},  
"match" : "\*",  
"match\_mapping\_type" : "string"  
}  
} ],

Is this expected? If so, why, and is there another way to remove  
accomplish what I want, i.e. have a .raw subfield for dynamically mapped  
string fields in all types but not gerrit\_event? (Without removing the  
subfield from _default_ and adding it in many other places, obviously.)

--  
Magnus Bäck | Software Engineer, Development Tools  
[magnus.back@sonymobile.com](mailto:magnus.back@sonymobile.com) | Sony Mobile Communications

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/20150226155719.GA16432%40seldlx20533.corpusers.net](https://groups.google.com/d/msgid/elasticsearch/20150226155719.GA16432%40seldlx20533.corpusers.net).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<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:29am UTC](https://discuss.elastic.co/t/removing-subfield-in-concrete-mapping/22412/2 "2017-07-06T00:29:51Z")

</div>


