liveBook · Manning

Static index setting

As explained in Elasticsearch in Action, Second Edition

A static index setting is an Elasticsearch index configuration value that can be set at index creation but cannot be changed while the index is operational.

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.

How Elasticsearch in Action, Second Edition covers it

How deep it goes
Explains creation-time application, live-index restrictions, and closing or re-creating indexes, while deferring individual setting details.
Examples
Uses a cars index configured with shards, replicas, compression, script fields, and refresh interval, then changes replicas live.
What it assumes
Assumes familiarity with Elasticsearch indexes and settings APIs while defining the static-versus-dynamic distinction.
What you can do after
Operate/configure Elasticsearch indexes by choosing static values early and distinguishing them from settings safely changed during operation.
How it connects
Connects static settings with dynamic settings, index creation, shards, replicas, compression codecs, and reindexing.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Elasticsearch in Action, Second Edition. The section links point to the parts of the book it draws on.