title: Elasticsearch mapping - different data types in same field
body: <p>I am trying to to create a mapping that will allow me to have a document looking like this:</p>
  
  <pre><code>{
      "created_at" : "2014-11-13T07:51:17+0000",
      "updated_at" : "2014-11-14T12:31:17+0000",
      "account_id" : 42,
      "attributes" : [
      {
          "name" : "firstname",
          "value" : "Morten",
          "field_type" : "string"
      },
      {
          "name" : "lastname",
          "value" : "Hauberg",
          "field_type" : "string"
      },
      {
          "name" : "dob",
          "value" : "1987-02-17T00:00:00+0000",
          "field_type" : "datetime"
      }
  ]
  </code></pre>
  
  <p>}</p>
  
  <p>And the <code>attributes</code> array must be of type nested, and dynamic, so i can add more objects to the array and index it by the <code>field_type</code> value.</p>
  
  <p>Is this even possible?</p>
  
  <p>I have been looking at the dynamic_templates. Can i use that?</p>