A dynamic index setting lets you adjust selected index behavior without taking a running index offline. This is useful when production search needs change: increase replicas for more read capacity, alter the refresh interval, or temporarily allow or block writes. Elasticsearch accepts these changes only for settings classified as dynamic; static settings require a closed index or a replacement index. section 6.2.3 section 14.1.3
For example, a car-search index might start with five replicas, then need fewer replicas after demand drops. Send an update to the index’s `_settings` endpoint rather than recreating the index. section 6.2.3
Listing 6.6 Updating dynamic property on an index
PUT cars_with_custom_settings/_settings
{
"settings": {
"number_of_replicas": 2
}
}
This request changes `number_of_replicas` from its current value to `2` while `cars_with_custom_settings` remains operational. `number_of_replicas` is dynamic, so the update does not require closing the index. section 6.2.3
Use dynamic settings for operational changes such as:
- Changing `number_of_replicas` to add or remove copies of each shard. section 6.2.3 section 14.1.3
- Adjusting the refresh interval on an operational index. section 6.2.3
- Allowing or disallowing writes without stopping the index. section 6.2.3
Scale reads by adding replicas
If read queries become a bottleneck, increase `number_of_replicas` on the live index. Each added replica is a copy of a shard and can serve read requests, so Elasticsearch can route more searches across replicas. Plan cluster memory and disk capacity first: every replica consumes resources comparable to its primary shard. section 14.1.3
Do not treat every index setting as dynamic. `number_of_shards`, compression codec, and startup data checks are static examples. Trying to update a static setting on a live index produces an error; changing shard count requires closing and recreating the index, then reindexing data if needed. Set required static choices at creation time, and reserve dynamic settings for runtime tuning. section 6.2.3 section 14.1.3
