Index exists

Introduced 1.0

The index exists API operation returns whether or not an index already exists.

Path and HTTP methods

  1. HEAD /<index-name>

Query parameters

All parameters are optional.

ParameterTypeDescription
allow_no_indicesBooleanWhether to ignore wildcards that don’t match any indexes. Default is true.
expand_wildcardsStringExpands wildcard expressions to different indexes. Combine multiple values with commas. Available values are all (match all indexes), open (match open indexes), closed (match closed indexes), hidden (match hidden indexes), and none (do not accept wildcard expressions). Default is open.
flat_settingsBooleanWhether to return settings in the flat form, which can improve readability, especially for heavily nested settings. For example, the flat form of “index”: { “creation_date”: “123456789” } is “index.creation_date”: “123456789”.
include_defaultsBooleanWhether to include default settings as part of the response. This parameter is useful for identifying the names and current values of settings you want to update.
ignore_unavailableBooleanIf true, OpenSearch does not search for missing or closed indexes. Default is false.
localBooleanWhether to return information from only the local node instead of from the cluster manager node. Default is false.

Example request

  1. HEAD /sample-index

copy

Example response

The index exists API operation returns only one of two possible response codes: 200 – the index exists, and 404 – the index does not exist.