This API follows reindex tasks across node-shutdown relocations, so callers can keep using the original task ID throughout the lifetime of the operation. Returned task IDs and timings reflect the original task, not its relocated successor. Relocated task IDs are also supported. They are followed transparently and return the task ID and timings of the original task.
When the task ID cannot be resolved, the API returns the response below with a 404 status code. This response is used whether the ID is unknown, refers to a non-reindex task, refers to a sliced child subtask, or refers to a task whose node left the cluster with no stored result (e.g. a non-graceful shutdown).
{
"error": {
"type": "resource_not_found_exception",
"reason": "Reindex operation [r1A2WoRbTwKZ516z6NEs5A:36619] not found"
},
"status": 404
}
GET
/_reindex/{task_id}
Console
GET _reindex/r1A2WoRbTwKZ516z6NEs5A:36619
resp = client.get_reindex(
task_id="r1A2WoRbTwKZ516z6NEs5A:36619",
)
const response = await client.getReindex({
task_id: "r1A2WoRbTwKZ516z6NEs5A:36619",
});
response = client.get_reindex(
task_id: "r1A2WoRbTwKZ516z6NEs5A:36619"
)
$resp = $client->getReindex([
"task_id" => "r1A2WoRbTwKZ516z6NEs5A:36619",
]);
curl -X GET -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_reindex/r1A2WoRbTwKZ516z6NEs5A:36619"
var response = await client.GetReindexAsync(taskId: "r1A2WoRbTwKZ516z6NEs5A:36619");
client.getReindex(g -> g
.taskId("r1A2WoRbTwKZ516z6NEs5A:36619")
);
Response examples (200)
In-progress task
A successful response for an in-progress reindex task. The `status` block reports current progress; the `response` block is absent until the task completes.
{
"completed": false,
"id": "r1A2WoRbTwKZ516z6NEs5A:36619",
"description": "reindex from [reindex_src] to [reindex_dst]",
"start_time_in_millis": 1778265266199,
"running_time_in_nanos": 1588606084,
"cancelled": false,
"status": {
"total": 0,
"updated": 0,
"created": 0,
"deleted": 0,
"batches": 0,
"version_conflicts": 0,
"noops": 0,
"retries": {
"bulk": 0,
"search": 0
},
"throttled_millis": 0,
"requests_per_second": 4.0,
"throttled_until_millis": 0,
"slices": [
null,
null
]
}
}
A successful response for a completed reindex task. The final outcome is in the `response` block.
{
"completed": true,
"id": "r1A2WoRbTwKZ516z6NEs5A:36619",
"description": "reindex from [reindex_src] to [reindex_dst]",
"start_time_in_millis": 1778265266199,
"running_time_in_nanos": 35457187167,
"cancelled": false,
"status": {
"total": 240,
"updated": 0,
"created": 240,
"deleted": 0,
"batches": 120,
"version_conflicts": 0,
"noops": 0,
"retries": {
"bulk": 0,
"search": 0
},
"throttled_millis": 2999,
"requests_per_second": -1.0,
"throttled_until_millis": 0,
"slices": [
{
"slice_id": 0,
"total": 174,
"updated": 0,
"created": 174,
"deleted": 0,
"batches": 87,
"version_conflicts": 0,
"noops": 0,
"retries": {
"bulk": 0,
"search": 0
},
"throttled_millis": 999,
"requests_per_second": -1.0,
"throttled_until_millis": 0
},
{
"slice_id": 1,
"total": 66,
"updated": 0,
"created": 66,
"deleted": 0,
"batches": 33,
"version_conflicts": 0,
"noops": 0,
"retries": {
"bulk": 0,
"search": 0
},
"throttled_millis": 1999,
"requests_per_second": -1.0,
"throttled_until_millis": 0
}
]
},
"response": {
"took": 35434,
"timed_out": false,
"total": 240,
"updated": 0,
"created": 240,
"deleted": 0,
"batches": 120,
"version_conflicts": 0,
"noops": 0,
"retries": {
"bulk": 0,
"search": 0
},
"throttled": "2.9s",
"throttled_millis": 2999,
"requests_per_second": -1.0,
"throttled_until": "0s",
"throttled_until_millis": 0,
"slices": [
{
"slice_id": 0,
"total": 174,
"updated": 0,
"created": 174,
"deleted": 0,
"batches": 87,
"version_conflicts": 0,
"noops": 0,
"retries": {
"bulk": 0,
"search": 0
},
"throttled": "999.9ms",
"throttled_millis": 999,
"requests_per_second": -1.0,
"throttled_until": "0s",
"throttled_until_millis": 0
},
{
"slice_id": 1,
"total": 66,
"updated": 0,
"created": 66,
"deleted": 0,
"batches": 33,
"version_conflicts": 0,
"noops": 0,
"retries": {
"bulk": 0,
"search": 0
},
"throttled": "1.9s",
"throttled_millis": 1999,
"requests_per_second": -1.0,
"throttled_until": "0s",
"throttled_until_millis": 0
}
],
"failures": []
}
}