Multi-target syntaxedit

Most APIs that accept a <data-stream>, <index>, or <target> request path parameter also support multi-target syntax.

In multi-target syntax, you can use a comma-separated list to run a request on multiple resources, such as data streams, indices, or index aliases: test1,test2,test3. You can also use glob-like wildcard (*) expressions to target resources that match a pattern: test* or *test or te*t or *test*.

You can exclude targets using the - character: test*,-test3.

Index aliases are resolved after wildcard expressions. This can result in a request that targets an excluded alias. For example, if test3 is an index alias, the pattern test*,-test3 still targets the indices for test3. To avoid this, exclude the concrete indices for the alias instead.

Multi-target APIs that can target indices support the following query string parameters:

ignore_unavailable
(Optional, boolean) If true, missing or closed indices are not included in the response. Defaults to false.
allow_no_indices
(Optional, boolean) 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. For example, a request targeting foo*,bar* returns an error if an index starts with foo but no index starts with bar.
expand_wildcards

(Optional, string) Controls what kind of indices that wildcard expressions can expand to. Multiple values are accepted when separated by a comma, as in open,hidden. Valid values are:

all
Expand to open and closed indices, including hidden indices.
open
Expand only to open indices.
closed
Expand only to closed indices.
hidden
Expansion of wildcards will include hidden indices. Must be combined with open, closed, or both.
none
Wildcard expressions are not accepted.

The defaults settings for the above parameters depend on the API being used.

Some indices (hereafter "system indices") are used by various system modules and/or plugins to store state or configuration. These indices are not intended to be accessed directly, and accessing them directly is deprecated. In the next major version, access to these indices will no longer be allowed to prevent accidental operations that may cause problems with Elasticsearch features which depend on the consistency of data in these indices.

Some multi-target APIs that can target indices also support the following query string parameter:

ignore_throttled
(Optional, boolean) If true, concrete, expanded or aliased indices are ignored when frozen. Defaults to true.

Single index APIs, such as the Document APIs and single-index alias APIs, do not support multi-target syntax.