[英]Difference between elasticsearch ReIndex task REST API implementation and Java rest high level client
Hi I'm trying to use elastic search reindex api via rest high level client and am comparing two ways of doing it.您好我正在尝试通过 rest 高级客户端使用弹性搜索重新索引 api 并比较两种方法。
Rest API: Rest API:
https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-reindex.html#docs-reindex-task-api [![Rest API Documentation screenshot][1]][1] 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 high level client: 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 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] [![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.
I'm trying to figure out this: From Rest API Doc I know that I should delete the task document so Elasticsearch can reclaim the space.我想弄清楚这个: 来自 Rest API Doc 我知道我应该删除任务文档,以便 Elasticsearch 可以回收空间。 Since the rest high level client is basically doing the same thing, do I need to "delete the task document" if I choose to use this client instead of the rest API?
由于rest高级客户端基本上做同样的事情,如果我选择使用此客户端而不是rest API,是否需要“删除任务文档”? If so, how can I do that?
如果是这样,我该怎么做?
Thanks [1]: https://i.stack.imgur.com/OEVHi.png [2]: https://i.stack.imgur.com/sw9Dw.png感谢 [1]: https://i.stack.imgur.com/OEVHi.png [2]: https://i.stack.imgur.com/sw9Dw.png
The task document is just a summary of what happen during reindex (so a small document), since you specify to do in async with wait_for_completion=false
it will be created in system indice .tasks
, so you can query this indice like any other to find the summary and delete it.任务文档只是重新索引期间发生的事情的摘要(所以是一个小文档),因为您指定在 async with
wait_for_completion=false
中执行它将在系统.tasks
中创建,因此您可以像查询任何其他索引一样查询此索引找到摘要并将其删除。
The .tasks
indice will not be available by default in futur version of Elasticsearch and you will need to use specific function linked to _tasks
with the java REST api available here .tasks
在 Elasticsearch 的未来版本中默认不可用,您需要使用链接到_tasks
的特定 function 和 java REST api 可在此处获得
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.