Updated on 2024-11-29 GMT+08:00

Index Template

Overview

Elasticsearch presets an index template using a self-developed plug-in to facilitate user operations. You can modify the index template parameters when using the index template. The name of the index template provided by Elasticsearch is bigdata_default_template. For details, see Table 1.

Table 1 Index template parameters

Parameter

Default Value

Description

order

0

Index template priority, which is not displayed and cannot be modified.

index_patterns

["*"]

Wildcard characters used to match the index, which are not displayed and cannot be modified.

index.template.enable

true

Indicates whether to enable the index template. The value is true or false.

settings.index.refresh_interval

60s

Refresh rate of indices, which can be modified. The value ranges from 1 to 3000, in seconds.

settings.index.search.slowlog.threshold.query.warn

10s

Threshold. Logs of the WARN level are printed when the query duration exceeds the threshold. The value can be modified. The value ranges from 1 to 3000, in seconds.

settings.index.search.slowlog.threshold.query.info

5s

Threshold. Logs of the INFO level are printed when the query duration exceeds the threshold. The value can be modified. The value ranges from 1 to 3000, in seconds.

settings.index.search.slowlog.threshold.query.debug

2s

Threshold. Logs of the DEBUG level are printed when the query duration exceeds the threshold. The value can be modified. The value ranges from 1 to 3000, in seconds.

settings.index.search.slowlog.threshold.query.trace

500ms

Threshold. Logs of the TRACE level are printed when the query duration exceeds the threshold. The value can be modified. The value ranges from 1 to 3000, in seconds or milliseconds.

settings.index.unassigned.node_left.delayed_timeout

10m

Delay in allocating shards after an instance leaves the cluster. The value can be modified. The value ranges from 1 to 3000, in minutes.

Index Template Usage

  1. Log in to Manager.
  2. Choose Cluster > Name of the desired cluster > Services > Elasticsearch > Configurations > All Configurations.

    All index template service operations can take effect dynamically. You do not need to restart the Elasticsearch service.

  3. Perform service operations as required. The index template supports the following service operations:

    1. Enable or disable the index template

      Select Index Template.

      • To disable the index template, set the value of index.template.enable to false.
      • To enable the index template, set the value of index.template.enable to true.
    1. Modify default parameters

      Select Index Template and modify default parameters based on service requirements.

      You are advised to retain the default values of the index template parameters.

    1. Adding custom parameters

      Select Custom, change the value of elasticsearch.index.template.configs, and add the parameter name and value.

      Ensure that the input custom index template parameter is correct. If the input is incorrect, the configuration will fail to be saved and the Elasticsearch service cannot be started.

  4. After the modification, click Save in the upper left corner. In the dialog box displayed, click OK.