title: Disable dynamic mapping creation for only specific indexes on elasticsearch?
body: <p>I'm trying to disable dynamic mapping creation for only specific indexes, not for all. For some reason I can't put <em>default</em> mapping with 'dynamic' : 'false'.
  So, here left two options as I can see:</p>
  
  <ol>
  <li>specify property <em>'index.mapper.dynamic'</em> in file <em>elasticsearch.yml</em>.</li>
  <li>put <em>'index.mapper.dynamic'</em> at index creation time, as described here <a href="https://www.elastic.co/guide/en/kibana/current/setup.html#kibana-dynamic-mapping">https://www.elastic.co/guide/en/kibana/current/setup.html#kibana-dynamic-mapping</a></li>
  </ol>
  
  <p>First option may only accept values: true, false and strict. So there is no way to specify subset of specific indexes (like we do by pattern with property <em>'action.auto_create_index'</em> <a href="https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-index_.html#index-creation">https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-index_.html#index-creation</a>).</p>
  
  <p>Second option just not works. 
  I've created index</p>
  
  <pre><code>POST http://localhost:9200/test_idx/
  {
      "settings" : {
          "mapper" : {
              "dynamic" : false
          }
      },
      "mappings" : {
          "test_type" : {
              "properties" : {
                  "field1" : {
                      "type" : "string"
                  }
              }
          }
      }
  }
  </code></pre>
  
  <p>Then checked index settings:</p>
  
  <pre><code>GET http://localhost:9200/test_idx/_settings    
  {
      "test_idx" : {
          "settings" : {
              "index" : {
                  "mapper" : {
                      "dynamic" : "false"
                  },
                  "creation_date" : "1445440252221",
                  "number_of_shards" : "1",
                  "number_of_replicas" : "0",
                  "version" : {
                      "created" : "1050299"
                  },
                  "uuid" : "5QSYSYoORNqCXtdYn51XfA"
              }
          }
      }
  }
  </code></pre>
  
  <p>and mapping:</p>
  
  <pre><code>GET http://localhost:9200/test_idx/_mapping
  {
      "test_idx" : {
          "mappings" : {
              "test_type" : {
                  "properties" : {
                      "field1" : {
                          "type" : "string"
                      }
                  }
              }
          }
      }
  }
  </code></pre>
  
  <p>so far so good, let's index document with undeclared field:</p>
  
  <pre><code>POST http://localhost:9200/test_idx/test_type/1
  {
      "field1" : "it's ok, field must be in mapping and in source",
      "somefield" : "but this field must be in source only, not in mapping"
  }
  </code></pre>
  
  <p>Then I've checked mapping again:</p>
  
  <pre><code>GET http://localhost:9200/test_idx/_mapping
  {
      "test_idx" : {
          "mappings" : {
              "test_type" : {
                  "properties" : {
                      "field1" : {
                          "type" : "string"
                      },
                      "somefield" : {
                          "type" : "string"
                      }
                  }
              }
          }
      }
  }
  </code></pre>
  
  <p>As you can see, mapping is extended regardless of index setting "dynamic" : false.
  I've also tried to create index exactly as described in doc </p>
  
  <pre><code>PUT http://localhost:9200/test_idx
  {
      "index.mapper.dynamic": false
  }
  </code></pre>
  
  <p>but got the same behavior.</p>
  
  <p>Maybe I've missed something?</p>
  
  <p>Thanks a lot in advance!</p>