{"id":348,"date":"2022-08-04T22:25:57","date_gmt":"2022-08-04T22:25:57","guid":{"rendered":"http:\/\/192.168.1.102\/?p=348"},"modified":"2022-10-19T18:31:57","modified_gmt":"2022-10-19T18:31:57","slug":"index-templates","status":"publish","type":"post","link":"https:\/\/192.168.12.139\/blog\/index-templates","title":{"rendered":"Index Templates"},"content":{"rendered":"

1. Overview<\/h2>\n

Index templates are the configurations of indices to be created. However, the configuration of an index can be altered after it is created individually.<\/span><\/p>\n

Whether an index is created manually or automatically while indexing a document, the new index will be created in the light of the template settings.<\/span><\/p>\n

A template can be either a\u00a0<\/span>composable index template<\/span><\/strong>\u00a0(introduced in\u00a0<\/span>Elasticsearch 7.8<\/span><\/em>, index template) or a\u00a0<\/span>component template<\/span><\/strong>. Component templates are, as their name indicates,\u00a0<\/span>building blocks<\/span><\/em>\u00a0that can be used again and again to create index templates, and they define\u00a0<\/span>mappings<\/span><\/em>,\u00a0<\/span>settings<\/span><\/em>, and\u00a0<\/span>aliases<\/span><\/em>. Component templates make it easier and faster to create index templates.<\/span><\/p>\n

The main purpose behind the component templates, making the templates more\u00a0<\/span>modular<\/span><\/em>\u00a0and more\u00a0<\/span>viable<\/span><\/em>\u00a0to apply with less effort.<\/span><\/p>\n

Index templates may contain many component templates other than directly specified settings, mappings, and aliases. Just because an index template is composed of component templates, it doesn’t mean they are directly applied to a set of indices.\u00a0<\/span><\/p>\n

In settings, specifications of an index are defined (<\/span>e.g.<\/span><\/strong>,\u00a0<\/span>number of shards<\/span><\/strong>,\u00a0<\/span>number of replicas<\/span><\/strong>,\u00a0<\/span>shard<\/span><\/strong>\u00a0<\/span>size<\/span><\/strong>, …)<\/span><\/p>\n

In mappings, how the documents will be stored in the index is defined.<\/span><\/p>\n

To remember an index’s name easily, aliases are used.<\/span><\/p>\n

Basic template behavior:<\/strong><\/p>\n