After you enable the scenario-based configuration feature, you can dynamically modify the index template of a cluster. This topic describes how to modify the index template of a cluster.

For more information about how to modify the index template of a cluster, see Use a scenario-based template to modify the configurations of a cluster. The following table describes the related parameters.
Notice The default index template is named aliyun_default_index_template. The default order value in the template is Integer.MIN_VALUE plus 1. This value is less than the order values of your custom index templates. We recommend that you do not change this value. This default index template provides configurations that are suitable for your selected scenario but does not affect your custom index templates.
Parameter Description
index_patterns The index pattern used by the index template to match indexes. Wildcards are supported. Default value: *.
Notice Alibaba Cloud Elasticsearch allows you to change this default value to adjust the impact scope of the default index template. However, we recommend that you do not change this value.
index.search.slowlog.level The level of a slow fetch or query log for a search request.
index.search.slowlog.threshold.fetch.warn The time threshold used to define a slow fetch log at the warn level.
index.search.slowlog.threshold.fetch.info The time threshold used to define a slow fetch log at the info level.
index.search.slowlog.threshold.fetch.debug The time threshold used to define a slow fetch log at the debug level.
index.search.slowlog.threshold.fetch.trace The time threshold used to define a slow fetch log at the trace level.
index.search.slowlog.threshold.query.warn The time threshold used to define a slow query log at the warn level.
index.search.slowlog.threshold.query.trace The time threshold used to define a slow query log at the trace level.
index.search.slowlog.threshold.query.info The time threshold used to define a slow query log at the info level.
index.search.slowlog.threshold.query.debug The time threshold used to define a slow query log at the debug level.
index.refresh_interval The interval at which a refresh operation is performed. Default value: 1s. For scenarios that do not have high requirements for real-time performance, you can increase the value of this parameter to reduce refresh overheads and improve cluster performance.
index.unassigned.node_left.delayed_timeout The delayed time for reallocating replica shards after a node is removed from a cluster. Default value: 1m. You can increase the value of this parameter to accelerate cluster recovery.
index.indexing.slowlog.threshold.index.warn The time threshold used to define a slow indexing log at the warn level.
index.indexing.slowlog.threshold.index.info The time threshold used to define a slow indexing log at the info level.
index.indexing.slowlog.threshold.index.debug The time threshold used to define a slow indexing log at the debug level.
index.indexing.slowlog.threshold.index.trace The time threshold used to define a slow indexing log at the trace level.
index.indexing.slowlog.level The level of a slow indexing log.
index.indexing.slowlog.source The number of characters in the source that the system records in a slow log.
index.number_of_shards The number of primary shards for an index. In versions earlier than Elasticsearch 7.x, the default value of this parameter is 5. In Elasticsearch 7.x and later, the default value of this parameter is 1. Setting this parameter to 1 effectively limits the number of primary shards on a cluster and prevents excessive workloads caused by numerous primary shards.
index.translog.durability Specifies whether a translog is synchronized to a disk and then committed after every indexing, deletion, update, or bulk request. Valid values:
  • request: The translog is synchronized to a disk and then committed after every request. This ensures that data in the translog is not lost if a node becomes abnormal.
  • async: The translog is synchronized to a disk and then committed on a regular basis. This improves write performance but deteriorates data reliability.
index.merge.policy.segments_per_tier The allowed number of segments per tier. A small value results in more merging operations but lower indexing performance. Default value: 10. We recommend that the value of this parameter is greater than or equal to that of index.merge.policy.max_merge_at_once. Otherwise, numerous merging operations occur, which lowers cluster performance.
index.merge.policy.max_merged_segment The maximum size of a merged segment during indexing. The value of this parameter is an approximate value. Default value: 5GB. The size of a merged segment is calculated by using the following formula:

Size of a merged segment = Total size of the segments that form the merged segment - Total size of the documents that are deleted from these segments

index.lifecycle.name The index lifecycle policy.
mappings._default_._all.enabled If you set this parameter to false, the _all field is disabled. In Elasticsearch 5.x, the default value of this parameter is true. We recommend that you set this parameter to false. In Elasticsearch 6.x, the default value of this parameter is false. In Elasticsearch 7.x, this parameter is deprecated.