RestHighLevelClient 批量插入 elasticsearch 7.9 版本警告

RestHighLevelClient 批量插入 elasticsearch 7.9 版本警告,第1张

RestHighLevelClient 批量插入 elasticsearch 7.9 版本警告

以下是警告信息

[types removal] Specifying types in bulk requests is deprecated

不建议在批量添加中指定 type 类型, 6.0 以后不建议这样玩

restHighLevelClient.bulk() 修改为 restHighLevelClient.index()

client.index(new IndexRequest(t.getIndexName(), t.getTypeName(), String.valueOf(id)).source(contentBuilder));

采用单条插入, 后警告消失

借鉴文档
https://gitlab.com/gitlab-org/gitlab/-/issues/299769

欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/zaji/5701662.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-12-17
下一篇 2022-12-17

发表评论

登录后才能评论

评论列表(0条)

保存