title: Python Elasticsearch error sorting keyword field
body: <p>Within a Python project I have an elastic search index that throws the following error when I sort on a given field: <code>elasticsearch.exceptions.RequestError: RequestError(400, 'search_phase_execution_exception', 'Fielddata is disabled on text fields by default. Set fielddata=true on [my_field] in order to load fielddata in memory by uninverting the inverted index. Note that this can however use significant memory. Alternatively use a keyword field instead.')</code></p>
  
  <p>Originally this was a text field and so I did what the message recommended and tried changing it to a keyword field or setting fielddata=True. Unfortunately, those changes still result in the exact same error message and so now I am confused.</p>
  
  <p>Here are the different ways I have tried defining the field in my document index. All result in the same error.</p>
  
  <pre class="lang-py prettyprint-override"><code>from elasticsearch_dsl import DocType, Index, field, Keyword
  
  class MyDoc(DocType):
      my_field = field.Text(fields={'raw': field.Keyword()})
      my_field = field.Keyword(fielddata=True)
      my_field = field.Keyword()
      my_field = Keyword()
      my_field = Keyword(fields={'raw': field.Keyword()})
  
  </code></pre>
  
  <p>My index mapping:</p>
  
  <pre><code>{
  my-index: {
  mappings: {
  doc: {
  properties: {
  code: {
  type: "text",
  fields: {
  keyword: {
  type: "keyword",
  ignore_above: 256
  }
  }
  },
  my_field: {
  type: "text",
  fields: {
  keyword: {
  type: "keyword",
  ignore_above: 256
  }
  }
  }
  }
  }
  }
  }
  }
  </code></pre>
  
  <p>My Query:</p>
  
  <pre><code>{'query': {'bool': {'filter': [{'bool': {'must_not': [{'terms': {'code': []}}]}}]}}, 'sort': ['my_field'], 'from': 0, 'size': 6}
  </code></pre>