Multi-target syntax

edit

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 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.

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 false, the request returns an error if it targets a missing or closed index. 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) 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. Valid values are:

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 patterns are not accepted.

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

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.

APIs with a single target, such as the get document API, do not support multi-target syntax.

Hidden data streams and indices

edit

For most APIs, wildcard expressions do not match hidden data streams and indices by default. To match hidden data streams and indices using a wildcard expression, you must specify the expand_wildcards query parameter.

You can create hidden data streams by setting data_stream.hidden to true in the stream’s matching index template. You can hide indices using the index.hidden index setting.

The backing indices for data streams are hidden automatically. Some features, such as machine learning, store information in hidden indices.

Global index templates that match all indices are not applied to hidden indices.

System indices

edit

Elasticsearch modules and plugins can store configuration and state information in internal system indices. You should not directly access or modify system indices as they contain data essential to the operation of the system.

Direct access to system indices is deprecated and will no longer be allowed in the next major version.