title: Elasticsearch fielddata unsupported while index mapping
body: <p>I'm trying to create an index in Elasticsearch through Python. I have a local instance of ES deployed and queries run fine. However, I have a schema. Here it is:</p>
  
  <pre><code>{
    "mappings": {
      "payment":{
        "properties":{
          "timestamp":{"type":"date"},
          "base_amount":{"type":"integer"},
          "derived_id":{"type":"keyword", "fielddata": true},
          "attempts":{"type":"integer"},
          "status":{"type":"text","fielddata":true},
          "error_code":{"type":"text","fielddata":true}
        }
      }
    }
  }
  </code></pre>
  
  <p>Here is the code I am using to create this index</p>
  
  <pre><code>import json
  
  import requests
  
  schema = {
      "mappings": {
          "payment": {
              "properties": {
                  "timestamp": {"type": "date"},
                  "base_amount": {"type": "integer"},
                  "derived_key": {"type": "keyword", "fielddata": True},
                  "attempts": {"type": "integer"},
                  "status": {"type": "text", "fielddata": True},
                  "error_code": {"type": "text", "fielddata": True}
              }
          }
      }
  }
  
  index = 'http://localhost:9200/payment_index_2016_08_21'
  r = requests.put(index, data=json.dumps(schema))
  
  print r.content
  </code></pre>
  
  <p>The error I get is</p>
  
  <blockquote>
    <p>{"error":{"root_cause":[{"type":"mapper_parsing_exception","reason":"Mapping
    definition for [derived_key] has unsupported parameters:  [fielddata :
    true]"}],"type":"mapper_parsing_exception","reason":"Failed to parse
    mapping [payment]: Mapping definition for [derived_key] has
    unsupported parameters:  [fielddata :
    true]","caused_by":{"type":"mapper_parsing_exception","reason":"Mapping
    definition for [derived_key] has unsupported parameters:  [fielddata :
    true]"}},"status":400}</p>
  </blockquote>
  
  <p>I don't understand why the <code>fielddata = true</code> is causing an issue, since I see it's allowed here <a href="https://www.elastic.co/guide/en/elasticsearch/reference/current/fielddata.html" rel="nofollow noreferrer">https://www.elastic.co/guide/en/elasticsearch/reference/current/fielddata.html</a>. Any clue what the issue behind this is?</p>