Update settings

Introduced 1.0

You can use the update settings API operation to update index-level settings. You can change dynamic index settings at any time, but static settings cannot be changed after index creation. For more information about static and dynamic index settings, see Configuring OpenSearch.

Aside from the static and dynamic index settings, you can also update individual plugins’ settings. To get the full list of updatable settings, run GET <target-index>/_settings?include_defaults=true.

Path and HTTP methods

  1. PUT /<index>/_settings

Path parameters

ParameterTypeDescription
<index>StringThe index to update. Can be a comma-separated list of multiple index names. Use _all or * to specify all indexes.

Query parameters

All update settings parameters are optional.

ParameterData typeDescription
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), which must be used with open, closed, or both. Default is open.
cluster_manager_timeoutTimeHow long to wait for a connection to the cluster manager node. Default is 30s.
preserve_existingBooleanWhether to preserve existing index settings. Default is false.
timeoutTimeHow long to wait for a connection to return. Default is 30s.

Request body

The request body must all of the index settings that you want to update.

  1. {
  2. "index.plugins.index_state_management.rollover_skip": true,
  3. "index": {
  4. "number_of_replicas": 4
  5. }
  6. }

Example request

  1. PUT /sample-index1/_settings
  2. {
  3. "index.plugins.index_state_management.rollover_skip": true,
  4. "index": {
  5. "number_of_replicas": 4
  6. }
  7. }

copy

Example response

  1. {
  2. "acknowledged": true
  3. }