When creating a car index, choose settings such as shard count and compression before the index starts serving traffic. A static index setting is applied during index creation and cannot be changed while the index is operational. Changing one later requires closing the index or creating a replacement with the desired configuration. section 6.2.3
Treat these settings differently from dynamic settings:
- Set static values during creation; examples include number_of_shards, codec, and startup data checks. section 6.2.3
- Change dynamic values on a live index; number_of_replicas, write permissions, and refresh intervals are examples. section 6.2.3 section 6.2.1
- Plan static values carefully because changing them afterward requires downtime for the index or a replacement strategy such as reindexing. section 6.2.3
Create an index with planned settings
PUT cars_with_custom_settings { "settings": { "number_of_shards": 3, "number_of_replicas": 5, "codec": "best_compression", "max_script_fields": 128, "refresh_interval": "60s" } } The settings object applies the intended configuration at creation time. Later, an operational update such as PUT cars_with_custom_settings/_settings with "number_of_replicas": 2 demonstrates the contrast: replica count is dynamic, while the shard count remains static.
