索引分类:
static: 只能在索引创建时间或关闭索引处设置它们。
dynamic: They can be changed on a live index using the update-index-settings API.
WARN:
在关闭索引上更改静态或动态索引设置可能会导致不正确的设置,而不删除和重新创建索引是不可能纠正的。
static index setting
下面是所有与特定索引模块不相关的静态索引设置的列表。
index.number_of_shards
索引应该具有的主碎片的数目。默认值为5。只能在索引创建时间设置此设置。它不能在封闭索引上更改。 注意:每个索引的碎片数量限制为1024个。此限制是一种安全限制,以防止意外创建索引,因为资源分配会破坏集群的稳定性。
The limit can be modified by specifying export ES_JAVA_OPTS="-Des.index.max_number_of_shards=128"
集群中每个节点的系统属性。
index.shard.check_on_startup
在打开之前是否检查碎片是否有损坏?。当检测到损坏,这将防止碎片被打开。
false
(默认)不检查腐败打开一个碎片时。
checksum
Check for physical corruption. (检查物理损坏)
true
Check for both physical and logical (逻辑) corruption (损坏) 这在CPU和内存使用方面要昂贵得多。
fix
检查物理和逻辑上的腐败。报告已损坏的段将自动删除。此选项可能导致数据丢失。慎用!
检查碎片可能花费大量时间在大型索引上。
index.codec
默认值压缩存储数据的lz4压缩,但这可以设置best_compression采用紧缩为一个更高的压缩比,在较慢的费用存储领域的绩效。如果您正在更新压缩类型,则在合并段后将应用新的压缩类型。段合并可以强制合并使用强制合并(force merge.)。
index.routing_partition_size
自定义路由值可以到达的碎片数,默认值为1,只能在索引创建时间设置。 This value must be less than the index.number_of_shards unless the index.number_of_shards value is also 1
有关如何使用此设置的详细信息,请参见路由到索引分区。
dynamic index setting
下面是所有动态索引设置的列表。 这与任何特定的索引模块不相关:
index.number_of_replicas
副本的数量每一碎片了。默认值为1。
index.auto_expand_replicas
根据可用节点的数量自动复制副本的数量。
设置为破折号分隔的下限和上限。 (e.g. 0-5) 或者使用所有的上界 (e.g. 0-all). 默认为false(即禁用)。
index.refresh_interval
频繁执行刷新操作,这使得对搜索可见的索引进行了最近的更改。默认值为1 Can be set to -1 to disable refresh.
index.max_result_window
最大值 from + size
搜索此索引 Defaults to 10000
搜索请求占用堆内存和时间成比例 from + size
这限制了内存
index.max_rescore_window
index.blocks.read_only
设置为true,使索引和索引元数据只读,false允许写入和元数据更改。
index.blocks.read_only_allow_delete
相同 index.blocks.read_only
但允许删除索引以释放资源。
index.blocks.read
设置为true以禁用对索引的读取操作。
index.blocks.write
设置为true以禁用对索引的写操作。
index.blocks.metadata
设置为true禁用索引元数据读取和写入。
index.max_refresh_listeners
最大数量 刷新的听众 在每一个碎片的索引 这些听众是用来实现刷新= wait_for。
Settings in other index modules
Analysis
设置定义分析仪,断词,过滤标记和字符过滤。
Index shard allocation
Control over where, when, and how shards are allocated to nodes. 控制节点在何处、何时以及如何分配给节点。
Mapping
Enable or disable dynamic mapping for an index. 启用或禁用索引的动态映射。
Merging
Control over how shards are merged by the background merge process. 控制后台合并过程如何合并碎片。
Similarities
Configure custom similarity settings to customize how search results are scored. 配置自定义相似设置以定制搜索结果是如何得分的。
Slowlog
Control over how slow queries and fetch requests are logged. 控制如何缓慢查询和提取请求的日志记录。
Store
Configure the type of filesystem used to access shard data. 配置用于访问共享数据文件系统的类型。
Translog
Control over the transaction log and background flush operations. 对事务日志和后台刷新操作的控制。