Elasticsearch 7.0 Cookbook(Fourth Edition)
上QQ阅读APP看书,第一时间看更新

How it works...

Elasticsearch provides a lot of options to tune index behaviors, such as the following:

  • Replica management:
    • index.number_of_replicas: This is the number of replicas each shard has
    • index.auto_expand_replicas: This allows you to define a dynamic number of replicas related to the number of shards
Using set index.auto_expand_replicas to 0-all allows the creation of an index that is replicated in every node. (This is very useful for settings or cluster-propagated data, such as language options or stopwords).
  • Refresh interval (default 1s): In the Refreshing an index recipe, we saw how to refresh an index manually. The index settings index.refresh_interval control the rate of automatic refreshing.
  • Write management: Elasticsearch provides several settings to block read or write operations in the index and to change metadata. They live in the index.blocks settings.
  • Shard allocation management: These settings control how the shards must be allocated. They live in the index.routing.allocation.* namespace.

There are other index settings that can be configured for very specific needs. In every new version of Elasticsearch, the community extends these settings to cover new scenarios and requirements.