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' | 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.b...@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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/elasticsearch/20150226155719.GA16432%40seldlx20533.corpusers.net.
For more options, visit https://groups.google.com/d/optout.

Reply via email to