GET _template/default@template command in Dev Tools on the Kibana page. The following describes the default template and its configuration items, which can be adjusted based on your actual needs.{"default@template": {"order": 1, // Priority of the template. The greater the value, the higher the priority"index_patterns": [ // Index to which the template is applied"*"],"settings": {"index": {"max_result_window": "65536", // Maximum query result window. If the result quantity exceeds this value, error message "Result window is too large" will be displayed, and you will need to increase this value"routing": {"allocation": {"include": {"temperature": "hot"}}},"refresh_interval": "30s", // Index refresh interval. The indexed document can only be queried after the interval elapses. If you have high requirement for real-time query, you can properly reduce this value, but a too small value will compromise the write performance"unassigned": {"node_left": {"delayed_timeout": "5m"}},"translog": {"sync_interval": "5s", // translog flush interval. A too small value will compromise the write performance"durability": "async"},"number_of_replicas": "1" // Number of replica shards}},"mappings": {"_default_": {"_all": {"enabled": false // It is recommended to set this parameter to disabled. The `_all` field contains all other fields to form a large string, which will take up a lot of disk space and compromise the write performance},"dynamic_templates": [ // Dynamic template{"message_full": { // Dynamically map the field named `message_full` to `text` and `keyword` types"match": "message_full","mapping": {"type": "text","fields": {"keyword": {"type": "keyword","ignore_above": 2048}}}}},{"message": { // Dynamically map the field named `message` to `text` type"match": "message","mapping": {"type": "text"}}},{"strings": { // Dynamically map a field of `string` type to `keyword` type"match_mapping_type": "string","mapping": {"type": "keyword"}}}]}},"aliases": {}}}
PUT _template/my_template command in Dev Tools on the Kibana page. Then, you can overwrite the configurations in the default index template by setting the order parameter of your own template to be greater than that of the default template.{"index_patterns" : ["*"],"order" : 2, // Make sure that the value of the `order` field in the template is greater than 1"settings" : {"index": {"number_of_shards" : 1}}}
string type are dynamically mapped to keyword type in order to prevent full-text indexing of all the data of text type. You can modify the specified fields of string type to text based on your business needs to allow full-text indexing:{"index_patterns" : ["*"],"order" : 2, // Make sure that the value of the `order` field in the template is greater than 1"mappings": {"properties": {"Field name": {"type": "text"}}}}
search-* index, you can create a template as shown below:{"index_patterns" : ["search-*"],"order" : 2, // Make sure that the value of the `order` field in the template is greater than 1"settings" : {"index": {"refresh_interval": "10s"}}}
Feedback