Stack Exchange
How to not create new elastic search type if it is not defined in the original schema?
If I set the following schema
curl -XPUT $myhost/some_index?pretty  -d '
{
  "mappings": {
    "_mapping_name": {
      "dynamic": false,
      "properties": {
          "field1":  { "type": "long", "store": true },
          "field2":  { "type": "long", "store": true }
      }
    },
  },
  "settings" : {
    "index" : {
        "number_of_shards" : 9,
        "number_of_replicas" : 1
    }
  }
}'

The following 
curl -H "Content-Type: application/json" -XPOST "$myhost:9200/some_index/brand_new_mapping_name/" -d "{ \"field1\" : \"2\", \"field2\" : \"1\"}"

Will create a new type brand_new_mapping_name
Is there a way to configure elastic search to not create the new type similar to new dynamic = false that prevent new field to be created?

can you add the new mapping created by elastic: https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-get-mapping.html

In version 5, there was a option to disable new mapping creation within the index settings: https://www.elastic.co/guide/en/elasticsearch/reference/5.5/dynamic-mapping.html#_disabling_automatic_type_creation
But in the recent version I can't find this in the documentation anymore. Probably this is because in the upcoming versions of elasticsearch the feature of multiple mappings per index will be removed: https://www.elastic.co/guide/en/elasticsearch/reference/6.5/removal-of-types.html 
Then you won't be able to create a second mapping anymore (by designh, and a config option (index.mapper.dynamic":false) is not needed anymore.
