繁体   English   中英

elasticsearch ReIndex 任务 REST API 实现和 Java rest 高级客户端之间的区别

[英]Difference between elasticsearch ReIndex task REST API implementation and Java rest high level client

您好我正在尝试通过 rest 高级客户端使用弹性搜索重新索引 api 并比较两种方法。
Rest API:
https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-reindex.html#docs-reindex-task-api [![其余 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.
rest 高层客户:
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 high level client Documentation screenshot][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 可以回收空间。 由于rest高级客户端基本上做同样的事情,如果我选择使用此客户端而不是rest API,是否需要“删除任务文档”? 如果是这样,我该怎么做?

感谢 [1]: https://i.stack.imgur.com/OEVHi.png [2]: https://i.stack.imgur.com/sw9Dw.png

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

.tasks在 Elasticsearch 的未来版本中默认不可用,您需要使用链接到_tasks的特定 function 和 java REST api 可在此处获得

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM