title: elasticSearch python API: error when put_mapping
body: <p>I am new to elasticsearch and want to use the official Python API. I have below code:</p>
  
  <pre><code>from elasticsearch import Elasticsearch
  
  es = Elasticsearch(timeout=60)
  es.indices.create(index='test')
  
  mapping={
            "mappings": {
              "user": {
                "properties": {
                  "name": { "type": "text" },
                  "user_name": { "type": "keyword" },
                  "email": { "type": "keyword" }
                }
              },
              "tweet": {
                "properties": {
                  "content": { "type": "text" },
                  "user_name": { "type": "keyword" },
                  "tweeted_at": { "type": "date" }
                }
              }
            }
          }
  es.indices.put_mapping(index='test',body=mapping)
  </code></pre>
  
  <p>However I got below error:</p>
  
  <p><strong>RequestError: RequestError(400, 'mapper_parsing_exception', 'Root mapping definition has unsupported parameters:  [mappings : {tweet={properties={tweeted_at={type=date}, user_name={type=keyword}, content={type=text}}}, user={properties={user_name={type=keyword}, name={type=text}, email={type=keyword}}}}]')</strong></p>
  
  <p>This mapping is copied from：<a href="https://www.elastic.co/guide/en/elasticsearch/reference/current/removal-of-types.html" rel="nofollow noreferrer">https://www.elastic.co/guide/en/elasticsearch/reference/current/removal-of-types.html</a></p>
  
  <p>Could anyone help figure out what was wrong here?</p>
  
  <p>Many thanks</p>