From 5e8cf3539bd82653aaa13f01610c61a453c9465e Mon Sep 17 00:00:00 2001 From: Jinggang Date: Tue, 5 Jun 2018 17:10:22 -0700 Subject: [PATCH] change taskId to nodeId:taskId to be more accurate Most APIs locate a task by nodeId:taskId. It is very confusing as examples like the following are not working because the taskId here actually means nodeId:taskId -------------------------------------------------- GET /_tasks/taskId -------------------------------------------------- Another change gives developers a better understanding of `wait_for_completion` parameter and how to delete a task document after completion. --- docs/reference/docs/delete-by-query.asciidoc | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/docs/reference/docs/delete-by-query.asciidoc b/docs/reference/docs/delete-by-query.asciidoc index 4c78f55f41f93..6c4ed53661064 100644 --- a/docs/reference/docs/delete-by-query.asciidoc +++ b/docs/reference/docs/delete-by-query.asciidoc @@ -153,7 +153,7 @@ If the request contains `wait_for_completion=false` then Elasticsearch will perform some preflight checks, launch the request, and then return a `task` which can be used with <> to cancel or get the status of the task. Elasticsearch will also create a -record of this task as a document at `.tasks/task/${taskId}`. This is yours +record of this task as a document at `.tasks/task/${nodeId:taskId}`. This is yours to keep or remove as you see fit. When you are done with it, delete it so Elasticsearch can reclaim the space it uses. @@ -357,7 +357,7 @@ With the task id you can look up the task directly: [source,js] -------------------------------------------------- -GET /_tasks/taskId:1 +GET /_tasks/nodeId:taskId -------------------------------------------------- // CONSOLE // TEST[catch:missing] @@ -369,6 +369,12 @@ and `wait_for_completion=false` was set on it then it'll come back with `wait_for_completion=false` creates at `.tasks/task/${taskId}`. It is up to you to delete that document. +A task with `wait_for_completion=true` is only "in-memory", meaning after completion, the task is gone. Checking the status or deleting the task document from system index `.task` will fail. A task with `wait_for_completion=false` is stored in `.task`. After completion, you can delete the task document to save space: +[source,js] +-------------------------------------------------- +DELETE .tasks/task/nodeId:taskId +-------------------------------------------------- +// CONSOLE [float] [[docs-delete-by-query-cancel-task-api]]