diff --git a/docs/reference/indices.asciidoc b/docs/reference/indices.asciidoc index e9f617c6b7280..944c0c0f90d4e 100644 --- a/docs/reference/indices.asciidoc +++ b/docs/reference/indices.asciidoc @@ -45,6 +45,11 @@ index settings, aliases, mappings, and index templates. * <> * <> * <> + +[float] +[[index-templates]] +=== Index templates: +* <> * <> [float] @@ -109,6 +114,8 @@ include::indices/get-settings.asciidoc[] include::indices/analyze.asciidoc[] +include::indices/template-exists.asciidoc[] + include::indices/templates.asciidoc[] include::indices/stats.asciidoc[] diff --git a/docs/reference/indices/template-exists.asciidoc b/docs/reference/indices/template-exists.asciidoc new file mode 100644 index 0000000000000..550297a505982 --- /dev/null +++ b/docs/reference/indices/template-exists.asciidoc @@ -0,0 +1,56 @@ +[[indices-template-exists]] +=== Index template exists API +++++ +Index template exists +++++ + +Checks if an index template exists. + + + +[source,js] +----------------------------------------------- +HEAD /_template/template_1 +----------------------------------------------- +// CONSOLE + + +[[template-exists-api-request]] +==== {api-request-title} + +`HEAD /_template/` + + +[[template-exists-api-desc]] +==== {api-description-title} + +Use the index template exists API +to determine whether one or more index templates exist. + +include::templates.asciidoc[tag=index-template-def] + + +[[template-exists-api-path-params]] +==== {api-path-parms-title} + +include::{docdir}/rest-api/common-parms.asciidoc[tag=index-template] + + +[[template-exists-api-query-params]] +==== {api-query-parms-title} + +include::{docdir}/rest-api/common-parms.asciidoc[tag=flat-settings] + +include::{docdir}/rest-api/common-parms.asciidoc[tag=local] + +include::{docdir}/rest-api/common-parms.asciidoc[tag=master-timeout] + + +[[template-exists-api-response-codes]] +==== {api-response-codes-title} + +`200`:: +Indicates all specified index templates exist. + +`404`:: +Indicates one or more specified index templates **do not** exist. diff --git a/docs/reference/indices/templates.asciidoc b/docs/reference/indices/templates.asciidoc index 60e65c3139454..6d6591cc4ff3a 100644 --- a/docs/reference/indices/templates.asciidoc +++ b/docs/reference/indices/templates.asciidoc @@ -1,11 +1,12 @@ [[indices-templates]] === Index Templates -Index templates allow you to define templates that will automatically be -applied when new indices are created. The templates include both -<> and <> -and a simple pattern template that controls whether the template should be -applied to the new index. +// tag::index-template-def[] +Index templates define <> and <> +that you can automatically apply when creating new indices. +{es} applies templates to new indices +based on an index pattern that matches the index name. +// end::index-template-def[] NOTE: Templates are only applied at index creation time. Changing a template will have no impact on existing indices. When using the create index API, the @@ -119,26 +120,6 @@ GET /_template -------------------------------------------------- // CONSOLE -[float] -[[indices-templates-exists]] -==== Template exists - -Used to check if the template exists or not. For example: - -[source,js] ------------------------------------------------ -HEAD _template/template_1 ------------------------------------------------ -// CONSOLE - -The HTTP status code indicates if the template with the given name -exists or not. Status code `200` means it exists and `404` means -it does not. - -NOTE: Before 7.0.0, the 'mappings' definition used to include a type name. Although mappings -no longer contain a type name by default, you can still use the old format by setting -the parameter include_type_name. For more details, please see <>. - [float] [[multiple-templates]] ==== Multiple Templates Matching diff --git a/docs/reference/rest-api/common-parms.asciidoc b/docs/reference/rest-api/common-parms.asciidoc index c8b4b171f0879..f281c2112fecf 100644 --- a/docs/reference/rest-api/common-parms.asciidoc +++ b/docs/reference/rest-api/common-parms.asciidoc @@ -141,6 +141,13 @@ tag::index[] used to limit the request. end::index[] +tag::index-template[] +``:: +(Required, string) +Comma-separated list or wildcard expression of index template names +used to limit the request. +end::index-template[] + tag::lenient[] `lenient`:: (Optional, boolean) If `true`, format-based query failures (such as