Resolve Index API
The Resolve Index API helps you understand how OpenSearch resolves aliases, data streams, and concrete indexes that match a specified name or wildcard expression.
Endpoints
GET /_resolve/index/<name> Path parameters
The following table lists the available path parameters. All path parameters are required.
| Parameter | Data type | Description |
|---|---|---|
name | String | The name, alias, data stream, or wildcard expression to resolve. |
Query parameters
The following table lists the available query parameters. All query parameters are optional.
| Parameter | Data type | Description |
|---|---|---|
expand_wildcards | String | Controls how wildcard expressions expand to matching indexes. Multiple values can be combined using commas. Valid values are: • all – Expand to open and closed indexes, including hidden ones.• open – Expand only to open indexes.• closed – Expand only to closed indexes.• hidden – Include hidden indexes (must be used with open, closed, or both).• none – Wildcard expressions are not accepted.Default: open. |
Example requests
The following sections provide example Resolve API requests.
Resolve a concrete index
GET /_resolve/index/my-index-001response = client.indices.resolve_index( name = "my-index-001" )Resolve indexes using a wildcard
GET /_resolve/index/my-index-*response = client.indices.resolve_index( name = "my-index-*" )Resolve a data stream or alias
If an alias or data stream named logs-app exists, use the following request to resolve it:
GET /_resolve/index/logs-appresponse = client.indices.resolve_index( name = "logs-app" )Resolve hidden indexes using a wildcard in a remote cluster
The following example shows an API request using a wildcard, a remote cluster, and expand_wildcards configured to hidden:
GET /_resolve/index/my-index-*,remote-cluster:my-index-*?expand_wildcards=hiddenresponse = client.indices.resolve_index( name = "my-index-*,remote-cluster:my-index-*", params = { "expand_wildcards": "hidden" } )Example response
{ "indices": [ { "name": "my-index-001", "attributes": [ "open" ] } ], "aliases": [], "data_streams": [] } Response body fields
| Field | Data type | Description |
|---|---|---|
indices | Array | A list of resolved concrete indexes. |
aliases | Array | A list of resolved index aliases. |
data_streams | Array | A list of matched data streams. |
Required permissions
If you are using the Security plugin, the user running these queries needs to have at least read permissions for the resolved index.