{"id":23979,"date":"2021-10-02T02:33:49","date_gmt":"2021-10-02T02:33:49","guid":{"rendered":"https:\/\/www.devopsschool.com\/blog\/?p=23979"},"modified":"2025-05-04T06:12:23","modified_gmt":"2025-05-04T06:12:23","slug":"elasticsearch-templates","status":"publish","type":"post","link":"https:\/\/www.devopsschool.com\/blog\/elasticsearch-templates\/","title":{"rendered":"Elasticsearch templates"},"content":{"rendered":"\n<p>An index template is a way to tell Elasticsearch how to configure an index when it is created.<\/p>\n\n\n\n<p>For data streams, the index template configures the stream\u2019s backing indices as they are created.<br>Templates are configured prior to index creation. When an index is created &#8211; either manually or through indexing a document &#8211; the template settings are used as a basis for creating the index.<\/p>\n\n\n\n<p>There are two types of templates:<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>index templates and<\/li><li>component templates.<\/li><\/ul>\n\n\n\n<p>Component templates are reusable building blocks that configure mappings, settings, and aliases. While you can use component templates to construct index templates, they aren\u2019t directly applied to a set of indices.<\/p>\n\n\n\n<p>Index templates can contain a collection of component templates, as well as directly specify settings, mappings, and aliases.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">The following requests create two component templates<\/h2>\n\n\n\n<script src=\"https:\/\/gist.github.com\/devops-school\/955c7a5745439044b8093ca4c5ed7403.js\"><\/script>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>An index template is a way to tell Elasticsearch how to configure an index when it is created. For data streams, the index template configures the stream\u2019s backing indices as&#8230; <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_joinchat":[],"footnotes":""},"categories":[5936],"tags":[],"class_list":["post-23979","post","type-post","status-publish","format-standard","hentry","category-elastic"],"_links":{"self":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts\/23979","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/comments?post=23979"}],"version-history":[{"count":1,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts\/23979\/revisions"}],"predecessor-version":[{"id":23980,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts\/23979\/revisions\/23980"}],"wp:attachment":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/media?parent=23979"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/categories?post=23979"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/tags?post=23979"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}