title: How to create alias for dynamic fields in elasticsearch dynamic templates?
body: <p>I am using elasticsearch 1.0.2 and using a sample dynamic template in my index. Is there anyway we can derive the field index name from a part of dynamic field Name</p>
  
  <p>This is my template </p>
  
  <pre><code>{"dynamic_templates":[
    "dyn_string_fields": {
      "match": "dyn_string_*",
      "match_mapping_type": "string",
      "mapping": {
        "type": "string",
        "index" : "analyzed",
        "index_name": "{name}"
      }
    }
  }]}
  </code></pre>
  
  <p>The dynamic templates work and I am able to add fields. Our goal is to add fields with the "dyn_string_" prefix but while searching it should be just the fieldname without the "dyn_string_" prefix. I tested using match_mapping_type to add fields but this will allow any field to be added. Does someone have any suggestions?</p>
  
  <p>I looked at Elasticsearch API and they have a transform feature in 1.3 which allows to modify the document before insertion.(unfortunately I will not be able to upgrade to that version.)</p>