【问题标题】:Difference between elasticsearch ReIndex task REST API implementation and Java rest high level clientelasticsearch ReIndex 任务 REST API 实现与 Java REST 高级客户端的区别
【发布时间】: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


    【解决方案1】:

    任务文档只是重新索引期间发生的事情的摘要(所以是一个小文档),因为您指定与wait_for_completion=false异步执行它将在系统索引.tasks中创建,因此您可以查询此索引像其他人一样找到摘要并将其删除。

    .tasks 索引将在未来版本的 Elasticsearch 中默认不可用,您需要使用与 _tasks 关联的特定函数以及可用的 java REST api here

    【讨论】:

      猜你喜欢
      • 2020-02-08
      • 1970-01-01
      • 1970-01-01
      • 2020-03-04
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多