【发布时间】:2019-10-18 13:07:47
【问题描述】:
我收到警告:
"[types removal] Specifying types in bulk requests is deprecated."]
我做错了什么?这是我的代码:
BulkRequest request = new BulkRequest();
for(Item item : items) {
IndexRequest indexRequest = new IndexRequest(INDEX_NAME, DOC_TYPE, item.getIdentifier());
indexRequest
.opType(DocWriteRequest.OpType.INDEX) // Index the source. If there an existing document with the id, it will be replaced.
.source(JsonUtility.toJson(item), XContentType.JSON);
request.add(indexRequest);
}
elastic.bulk(request, RequestOptions.DEFAULT);
【问题讨论】:
-
您可能正在使用 ES 7.0 或更高版本。检查你的版本
-
@JBone ,我收到了同样的警告信息,我正在使用带有 Spring Boot 的 7.4.0 版本,我该如何解决这个问题?,我应该怎么做?。
-
这个stackoverflow.com/questions/62322613/… 也可能导致该消息并且很难发现。基本上 - 如果您拼错端点,您会收到此错误消息。不确定它是否会发生在 ES 更高级别的客户端上,但值得一提的是,它花了大约一个小时才意识到。
标签: java elasticsearch