Throttle a reindex operation

Auth

Change the maximum number of documents to index per second for a particular reindex operation. For example, to unthrottle to unlimited documents per second:

POST _reindex/r1A2WoRbTwKZ516z6NEs5A:36619/_rethrottle?requests_per_second=-1
		

Rethrottling that speeds up the query takes effect immediately. Rethrottling that slows down the query will take effect after completing the current batch of documents. This behavior prevents scroll timeouts.

This API follows reindex tasks across node-shutdown relocations, so callers can keep using the original task ID throughout the lifetime of the operation. The relocated task ID is also accepted and is followed transparently. In either case, returned task IDs and timings reflect the original task, not its relocated successor.

The rethrottle may not have been applied to any tasks if either node_failures or task_failures are non-empty, or if the response contains no successfully rethrottled tasks — that is, no entries under nodes (returned with the default group_by=nodes in stack) or under tasks (returned in serverless, or in stack with group_by=none or group_by=parents).

Required privileges

Cluster privileges manage_reindex

Path parameters

task_id string required

The task identifier, returned when creating a reindex task, or by listing tasks via GET /_reindex or GET /_tasks. In stack, can be either the original task ID or the task ID of the relocated task.

Query parameters

requests_per_second number required

The maximum number of documents to index per second, across the entire reindex operation (including slices). It can be either -1 to turn off throttling or any decimal number like 1.7 or 12 to throttle to that level.

group_by enum · default: nodes

The way to group the tasks in the response. We recommend setting this to none, which provides the cleanest response format.

Supported values include:

  • nodes: Group tasks by node ID.
  • parents: Group tasks by parent task ID.
  • none: Do not group tasks.
Values: nodes parents none

Response

application/json
nodes map string to object

Tasks grouped by node, returned only when group_by=nodes (the default).

tasks union oneOf

The tasks that were successfully rethrottled. Always returned in serverless. Returned with group_by=none or group_by=parents in stack.

One of:
{} ReindexTask[]
action string required
cancellable boolean required
cancelled boolean required
description string required
id number required
node string required
running_time_in_nanos number required
start_time_in_millis number required
status object required
Same fields as status in tasks
type string required
headers object required