Errors encountered by elasticsearch in creating index and mapping

         According to station B black horse programmer’s es video tutorial operation, because the version used is the latest version, encountered in the video did not appear in the error.

Address:

http://127.0.0.1:9200/blog

  Request body:

{
  "settings": {
    "number_of_shards": 5,
    "number_of_replicas": 1
  },
  "mappings": {
    "hello": {
      "properties": {
		"id": {
			"type": "long",
			"store": true
		},
		"title": {
			"type": "text",
			"store": true,
			"index": true,
			"analyzer":"standard"
		},
		"content": {
			"type": "text",
			"store": true,
			"index": true,
			"analyzer":"standard"
		}
      }
    }
  }
}

Error message:

{
    "error": {
        "root_cause": [
            {
                "type": "mapper_parsing_exception",
                "reason": "Root mapping definition has unsupported parameters:  [hello : {properties={id={store=true, type=long}, title={analyzer=standard, index=true, store=true, type=text}, content={analyzer=standard, index=true, store=true, type=text}}}]"
            }
        ],
        "type": "mapper_parsing_exception",
        "reason": "Failed to parse mapping [_doc]: Root mapping definition has unsupported parameters:  [hello : {properties={id={store=true, type=long}, title={analyzer=standard, index=true, store=true, type=text}, content={analyzer=standard, index=true, store=true, type=text}}}]",
        "caused_by": {
            "type": "mapper_parsing_exception",
            "reason": "Root mapping definition has unsupported parameters:  [hello : {properties={id={store=true, type=long}, title={analyzer=standard, index=true, store=true, type=text}, content={analyzer=standard, index=true, store=true, type=text}}}]"
        }
    },
    "status": 400
}

Solution: after the request address, add?include_ type_ name=true

http://127.0.0.1:9200/blog?include_type_name=true

result:  

{
    "acknowledged": true,
    "shards_acknowledged": true,
    "index": "blog"
}

Read More: