liveBook · Manning

Index configuration

As explained in Elasticsearch in Action, Second Edition

An index configuration is the collection of mappings, settings, and aliases associated with an Elasticsearch index.

An index configuration combines mappings, settings, and aliases so an Elasticsearch index matches its data model and operational needs. section 6.2.1

Configure three complementary parts:

  • Mappings define field types and the rules Elasticsearch applies before storing data, such as text, keyword, long, or date. section 6.2.1
  • Settings control index behavior, including primary shards, replicas, refresh rate, and compression codec; dynamic settings can change while the index runs. section 6.2.1
  • Aliases provide alternate names for indexes, supporting a stable name separate from the physical index name. section 6.2.1

Create a cars index with configuration

PUT cars_index { "settings": { "number_of_replicas": 3, "codec": "best_compression" }, "mappings": { "properties": { "make": { "type": "text" } } }, "aliases": { "cars_search": {} } } Choose mappings deliberately: incorrect inferred types can make later searches unreliable. Select shard and replica values for the intended production workload.

Listing 6.3 Creating an index with custom settings
PUT cars_index_with_sample_settings   #1
{
  "settings": {                       #2
    "number_of_replicas": 3,
    "codec": "best_compression"
  }
}

Inspect the focused REST example for creating an index with custom settings, then compare it with mapping and alias configurations. section 6.2.1

How Elasticsearch in Action, Second Edition covers it

How deep it goes
Explains mappings, settings, aliases, and dynamic versus static settings, but defers detailed setting behavior.
Examples
Uses car documents and REST requests for mappings, custom settings, aliases, and configuration inspection.
What it assumes
Assumes basic Elasticsearch indexing and field data types while recapping mappings.
What you can do after
Operate/configure Elasticsearch indexes with explicit mappings, settings, and aliases.
How it connects
Connects mappings with data types, settings with shards and replicas, and aliases with index naming.

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.