《Elastic Stack 实战手册》——三、产品能力——3.4.入门篇——3.4.2.Elasticsearch基础应用——3.4.2.12.Reindex API(2) https://developer.aliyun.com/article/1230248
Response Body
执行_reindex时的,响应体参数释意:
异步执行 Reindex
如果请求的查询参数wait_for_completion设置为false,Elasticsearch 将会执行一些预检查,然后发起一个task,来运行你的 Reindex 任务,并立即返回你一个taskid,然后你可以通过这个taskid,去查看任务的运行结果,运行结果记录在系统索引 .tasks;如果任务执行完成,你可以删除掉该文档,以使 Elasticsearch 释放空间。
#异步执行 reindex 任务 POST _reindex?wait_for_completion=false { "source": { "index": "reindex_index-name-1" }, "dest": { "index": "reindex_index-name-2" } } #返回立即返回的任务 id { "task" : "ydZx8i8HQBe69T4vbYm30g:20987804" } #查看任务的运行情况 GET _tasks/ydZx8i8HQBe69T4vbYm30g:20987804 #response返回结果 { "completed" : true, "task" : { "node" : "ydZx8i8HQBe69T4vbYm30g", "id" : 20987804, "type" : "transport", "action" : "indices:data/write/reindex", "status" : { "total" : 2, "updated" : 0, "created" : 2, "deleted" : 0, "batches" : 1, "version_conflicts" : 0, "noops" : 0, "retries" : { "bulk" : 0, "search" : 0 }, "throttled_millis" : 0, "requests_per_second" : -1.0, "throttled_until_millis" : 0 }, "description" : "reindex from [reindex_index-name-1] to [reindex_index-name-2][_doc]", "start_time_in_millis" : 1620539345400, "running_time_in_nanos" : 84854825, "cancellable" : true, "headers" : { } }, "response" : { "took" : 82, "timed_out" : false, "total" : 2, "updated" : 0, "created" : 2, "deleted" : 0, "batches" : 1, "version_conflicts" : 0, "noops" : 0, "retries" : { "bulk" : 0, "search" : 0 }, "throttled" : "0s", "throttled_millis" : 0, "requests_per_second" : -1.0, "throttled_until" : "0s", "throttled_until_millis" : 0, "failures" : [ ] } } #实际任务运行结果会记录在 .tasks 索引 GET .tasks/_doc/ydZx8i8HQBe69T4vbYm30g:20987804 #返回值如下 { "_index" : ".tasks", "_type" : "_doc", "_id" : "ydZx8i8HQBe69T4vbYm30g:20987804", "_version" : 1, "_seq_no" : 1, "_primary_term" : 1, "found" : true, "_source" : { "completed" : true, "task" : { "node" : "ydZx8i8HQBe69T4vbYm30g", "id" : 20987804, "type" : "transport", "action" : "indices:data/write/reindex", "status" : { "total" : 2, "updated" : 0, "created" : 2, "deleted" : 0, "batches" : 1, "version_conflicts" : 0, "noops" : 0, "retries" : { "bulk" : 0, "search" : 0 }, "throttled_millis" : 0, "requests_per_second" : -1.0, "throttled_until_millis" : 0 }, "description" : "reindex from [reindex_index-name-1] to [reindex_index-name-2][_doc]", "start_time_in_millis" : 1620539345400, "running_time_in_nanos" : 84854825, "cancellable" : true, "headers" : { } }, "response" : { "took" : 82, "timed_out" : false, "total" : 2, "updated" : 0, "created" : 2, "deleted" : 0, "batches" : 1, "version_conflicts" : 0, "noops" : 0, "retries" : { "bulk" : 0, "search" : 0 }, "throttled" : "0s", "throttled_millis" : 0, "requests_per_second" : -1.0, "throttled_until" : "0s", "throttled_until_millis" : 0, "failures" : [ ] } } }
《Elastic Stack 实战手册》——三、产品能力——3.4.入门篇——3.4.2.Elasticsearch基础应用——3.4.2.12.Reindex API(4) https://developer.aliyun.com/article/1230244