title: Dynamic Mapping for Nested Type
body: <p>I am trying to create a dynamic mapping for objects like the following:</p>
  
  <pre><code>  {
      "product": {
          "productId": 99999,
          "manufacturerId": "A0001",
          "manufacturerCode": "A101LI",
          "name": "Test Product",
          "description": "Describe the product here.",
          "feature_details":{
              "category": "Category1",
              "brand": "Brand Name"
          },
          "feature_tpcerts":{
              "certifiedPass": true,
              "levelCertified": 2
          },
          "feature_characteristics":{
              "amount": 0.73,
              "location": 49464
          }
      }
  }
  </code></pre>
  
  <p>I would like the <code>feature_*</code> properties to be a nested type, which I have defined in the mapping below with the nested_feature template and it is working as expected. However, I also want to have each property in the nested object of the <code>feature_*</code>property to be <code>multi_value</code> with an additional <code>facet</code> property defined. I have tried the second nested_template template, but without any success.</p>
  
  <pre><code> {
      "product" : {
          "_timestamp" : {"enabled" : true, "store": "yes" },
          "dynamic_templates": [
              {
                "nested_feature": {
                  "match" : "feature_*",
                  "mapping" : {
                    "type" : "nested",
                    "stored": "true"
                  }
                }
              },
              {
                  "nested_template": {
                      "match": "feature_*.*",
                      "mapping": {
                          "type": "multi_field",
                          "fields": {
                              "{name}": {
                                  "type": "{dynamic_type}",
                                  "index": "analyzed"
                              },
                              "facet": {
                                  "type": "{dynamic_type}",
                                  "index": "not_analyzed"
                              }
                          }
                      }
                  }
              }           
          ],
          "properties" : {
              "productId" : { "type" : "integer", "store" : "yes"},
              "manufacturerId" : { "type" : "string", "store" : "yes", "index" : "analyzed"},
              "manufacturer" : { "type" : "string", "store" : "yes", "index" : "not_analyzed"},
              "manufacturerCode" : { "type" : "string", "store" : "yes"},
              "name" : {"type" : "string", "store" : "yes"},
              "description": {"type": "string", "index" : "analyzed"}
          }
      }
  }
  </code></pre>
  
  <p>Unfortunately, the properties within the <code>feature_*</code> properties are created from another process and can be almost any name/value pair. Any suggestions on how to use a dynamic template to setup a property as nested as well as make each property within the nested object <code>multi_field</code> with an additional <code>facet</code> property?</p>