title: ElasticSearch mapping for dynamic keys for indexing a map
body: <p>I have a sample json which I want to index into elasticsearch.
  Sample Json Indexed:</p>
  
  <pre><code>put test/names/1
  {
    "1" : {
      "name":"abc"
    },
    "2" : {
      "name":"def"
    },
    "3" : {
      "name":"xyz"
    }
  
  }
  </code></pre>
  
  <p>where ,
  index name : test,
  type name : names,
  id :1</p>
  
  <p>Now the default mapping generated by elasticsearch is :</p>
  
  <pre><code>{
     "test": {
        "mappings": {
           "names": {
              "properties": {
                 "1": {
                    "properties": {
                       "name": {
                          "type": "string"
                       }
                    }
                 },
                 "2": {
                    "properties": {
                       "name": {
                          "type": "string"
                       }
                    }
                 },
                 "3": {
                    "properties": {
                       "name": {
                          "type": "string"
                       }
                    }
                 },
                 "metadataFieldDefinition": {
                    "properties": {
                       "name": {
                          "type": "string"
                       }
                    }
                 }
              }
           }
        }
     }
  }
  </code></pre>
  
  <p>If the map size increases from 3 ( currently) to suppose thousand or million, then ElasticSearch will create a mapping for each which may cause a performance issue as the mapping collection will be huge .</p>
  
  <p>I tried creating a mapping by setting :</p>
  
  <pre><code>"dynamic":false,
  "type":object 
  </code></pre>
  
  <p>but it was overriden by ES. since it didnt match the indexed data.</p>
  
  <p>Please let me know how can I define a mapping so that ES. doesnot creates one like the above .</p>