Suppressed: org.elasticsearch.client.ResponseException: method [PUT], host [http://localhost:9200], URI [/search/doc/4?timeout=1m], status line [HTTP/1.1 400 Bad Request]
{"error":{"root_cause":[{"type":"invalid_type_name_exception","reason":"Document mapping type name can‘t start with ‘‘, found: [doc]"}],"type":"invalid_type_name_exception","reason":"Document mapping type name can‘t start with ‘‘, found: [_doc]"},"status":400}
at org.elasticsearch.client.RestClient.convertResponse(RestClient.java:283)
at org.elasticsearch.client.RestClient.performRequest(RestClient.java:261)
at org.elasticsearch.client.RestClient.performRequest(RestClient.java:235)
at org.elasticsearch.client.RestHighLevelClient.internalPerformRequest(RestHighLevelClient.java:1611)
... 5 more
旧版本ES必须指定type,新版java api默认type为_doc
IndexRequest indexRequest = new IndexRequest(INDEX, TYPE);
原文:https://www.cnblogs.com/bincoding/p/13525827.html