我正在开发一个使用 Elasticsearch 5.4 作为数据存储的项目。我需要更新索引中所有文档中的字段。我们使用 Java RestClient 来连接 Java 和 Elasticsearch,但我无法在 RestClient 5.4.3 中找到有关更新 API 的任何文档或资源。
有人可以指导我如何从这里继续吗!
注意:我无法使用传输客户端。
谢谢
最佳答案
您是否尝试在 _update_by_query
端点上执行 POST 请求?
请查看Update By Query API :
The simplest usage of
_update_by_query
just performs an update on every document in the index without changing the source.
和
So far we’ve only been updating documents without changing their source. That is genuinely useful for things like picking up new properties but it’s only half the fun.
_update_by_query
supports a script object to update the document.
关于java - Elasticsearch Rest 客户端更新操作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48719765/