Get index recovery information

  • GET /{index}/_recovery
  • GET /_recovery
Auth

Get information about ongoing and completed shard recoveries for one or more indices. For data streams, the API returns information for the stream's backing indices.

All recoveries, whether ongoing or complete, are kept in the cluster state and may be reported on at any time.

Shard recovery is the process of initializing a shard copy, such as restoring a primary shard from a snapshot or creating a replica shard from a primary shard. When a shard recovery completes, the recovered shard is available for search and indexing.

Recovery automatically occurs during the following processes:

  • When creating an index for the first time.
  • When a node rejoins the cluster and starts up any missing primary shard copies using the data that it holds in its data path.
  • Creation of new replica shard copies from the primary.
  • Relocation of a shard copy to a different node in the same cluster.
  • A snapshot restore operation.
  • A clone, shrink, or split operation.

You can determine the cause of a shard recovery using the recovery or cat recovery APIs.

The index recovery API reports information about completed recoveries only for shard copies that currently exist in the cluster. It only reports the last recovery for each shard copy and does not report historical information about earlier recoveries, nor does it report information about the recoveries of shard copies that no longer exist. This means that if a shard copy completes a recovery and then Elasticsearch relocates it onto a different node then the information about the original recovery will not be shown in the recovery API.

Required authorization

Index privileges monitor

Path parameters

index union string | string[] optional

Comma-separated list of data streams, indices, and aliases used to limit the request. Supports wildcards (*). To target all data streams and indices, omit this parameter or use * or _all.

Leave it out to use /_recovery.

Query parameters

active_only boolean · default: false

If true, the response only includes ongoing shard recoveries.

detailed boolean · default: false

If true, the response includes detailed information about shard recoveries.

allow_no_indices boolean · default: true

If false, the request returns an error if any wildcard expression, index alias, or _all value targets only missing or closed indices. This behavior applies even if the request targets other open indices.

expand_wildcards union oneOf · default: open

Type of index that wildcard patterns can match. If the request can target data streams, this argument determines whether wildcard expressions match hidden data streams. Supports comma-separated values, such as open,hidden.

Supported values include:

  • all: Match any data stream or index, including hidden ones.
  • open: Match open, non-hidden indices. Also matches any non-hidden data stream.
  • closed: Match closed, non-hidden indices. Also matches any non-hidden data stream. Data streams cannot be closed.
  • hidden: Match hidden data streams and hidden indices. Must be combined with open, closed, or both.
  • none: Wildcard expressions are not accepted.
Values: all open closed hidden none
ignore_unavailable boolean · default: false

If false, the request returns an error if it targets a missing or closed index.

Response

application/json
<string> object
shards object[] required
id number required
index object required
bytes object
percent number | string required
recovered number | string
recovered_in_bytes number | string required
recovered_from_snapshot number | string
recovered_from_snapshot_in_bytes number | string
reused number | string
reused_in_bytes number | string required
total number | string
total_in_bytes number | string required
files object required
details object[]
length number required
name string required
recovered number required
percent number | string required
recovered number required
reused number required
total number required
size object required
percent number | string required
recovered number | string
recovered_in_bytes number | string required
recovered_from_snapshot number | string
recovered_from_snapshot_in_bytes number | string
reused number | string
reused_in_bytes number | string required
total number | string
total_in_bytes number | string required
source_throttle_time string
source_throttle_time_in_millis number required
target_throttle_time string
target_throttle_time_in_millis number required
total_time string
total_time_in_millis number required
primary boolean required
source object required
hostname string
host string
transport_address string
id string
ip string
name string
bootstrap_new_history_uuid boolean
repository string
snapshot string
version string
restoreUUID string
index string
stage string required
start object
check_index_time string
check_index_time_in_millis number required
total_time string
total_time_in_millis number required
start_time union oneOf
One of: string or number
start_time_in_millis number required
stop_time union oneOf
One of: string or number
stop_time_in_millis number
target object required
Same fields as source in shards
total_time string
total_time_in_millis number required
translog object required
percent number | string required
recovered number required
total number required
total_on_start number required
total_time string
total_time_in_millis number required
type string required
verify_index object required
check_index_time string
check_index_time_in_millis number required
total_time string
total_time_in_millis number required