Elasticsearch 简明教程

Elasticsearch - Index Modules

这些是为每个索引创建的模块,它们控制索引的设置和行为。例如,一个索引可以使用多少个分片,或者一个主分片可以为该索引拥有多少个副本等。索引设置有两种类型:

These are the modules which are created for every index and control the settings and behaviour of the indices. For example, how many shards an index can use or the number of replicas a primary shard can have for that index etc. There are two types of index settings −

  1. Static − These can be set only at index creation time or on a closed index.

  2. Dynamic − These can be changed on a live index.

Static Index Settings

下表显示了静态索引设置的列表:

The following table shows the list of static index settings −

Setting

Possible value

Description

index.number_of_shards

Defaults to 5, Maximum 1024

The number of primary shards that an index should have.

index.shard.check_on_startup

Defaults to false. Can be True

Whether or not shards should be checked for corruption before opening.

index.codec

LZ4 compression.

Type of compression used to store data.

index.routing_partition_size

1

The number of shards a custom routing value can go to.

index.load_fixed_bitset_filters_eagerly

false

Indicates whether cached filters are pre-loaded for nested queries

Dynamic Index Settings

下表列出了动态索引的设置列表−

The following table shows the list of dynamic index settings −

Setting

Possible value

Description

index.number_of_replicas

Defaults to 1

The number of replicas each primary shard has.

index.auto_expand_replicas

A dash delimited lower and upper bound (0-5)

Auto-expand the number of replicas based on the number of data nodes in the cluster.

index.search.idle.after

30seconds

How long a shard cannot receive a search or get request until it’s considered search idle.

index.refresh_interval

1 second

How often to perform a refresh operation, which makes recent changes to the index visible to search.