简体   繁体   English

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

[英]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.

相关问题 如何使用 java 高级别 rest3A84DEFA4886DAFCE6A4E7AE63A3BAEED443C48Z 在 elasticsearch 中知道是成功还是失败 - How to know if a reindex from remote task is sucessful or failed in elasticsearch using the java high level rest API ElasticSearch ReIndex 请求未使用 Java Rest 高级客户端以同步方式工作 - ElasticSearch ReIndex Request not working in synchronous manner using Java Rest High Level Client 使用 java 中的 Rest 高级客户端重新索引选定的 _source 字段 - Reindex selected _source fields using Rest high level client in java Elasticsearch Java 高级 Rest 客户端(已弃用)VS Java 客户端 API - Elasticsearch Java High Level Rest client (deprecated) VS Java Client API Elasticsearch高级Rest Client Java排序不正常 - Elasticsearch High Level Rest Client Java sorting not working properly ElasticSearch 多词查询与 Java 高级 REST 客户端 - ElasticSearch Multi Term Query With Java High-Level REST Client ElasticSearch Java高级Rest客户端:建议搜索 - ElasticSearch Java high Level Rest Client: Suggest-search ElasticSearch Java 高级 REST 客户端:过滤文档和或查询 - ElasticSearch Java High Level REST Client: filter documents and or query 如何使用Java High Level Rest Client API映射elasticsearch查询的结果集? - How to map the resultset of elasticsearch query with Java High Level Rest Client API? 在使用Java高级其余客户端批量API创建动态Elasticsearch索引时需要帮助 - Need help in creating dynamic elasticsearch index using Java high level rest client bulk API
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM