【发布时间】:2021-08-26 07:16:43
【问题描述】:
您好,我正在尝试通过其他高级客户端使用弹性搜索重新索引 api,并且正在比较两种方法。
休息API:
https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-reindex.html#docs-reindex-task-api
[![Rest API 文档截图][1]][1]Running reindex asynchronously - If the request contains wait_for_completion=false, Elasticsearch performs some preflight checks, launches the request, and returns a task you can use to cancel or get the status of the task. Elasticsearch creates a record of this task as a document at _tasks/<task_id>. When you are done with a task, you should delete the task document so Elasticsearch can reclaim the space.
休息高级客户:
https://www.elastic.co/guide/en/elasticsearch/client/java-rest/current/java-rest-high-document-reindex.html#java-rest-high-document-reindex-task-submission
[![rest 高级客户端文档截图][2]][2]Reindex task submission - It is also possible to submit a ReindexRequest and not wait for it completion with the use of Task API. This is an equivalent of a REST request with wait_for_completion flag set to false.
我试图弄清楚这一点:从 Rest API Doc 我知道我应该删除任务文档,以便 Elasticsearch 可以回收空间。由于其余高级客户端基本上是在做同样的事情,如果我选择使用此客户端而不是其余 API,是否需要“删除任务文档”?如果是这样,我该怎么做?
谢谢 [1]:https://i.stack.imgur.com/OEVHi.png [2]:https://i.stack.imgur.com/sw9Dw.png
【问题讨论】:
标签: java elasticsearch