From 7c26e81120cd6918116496f30664e0cc87d6d6ac Mon Sep 17 00:00:00 2001 From: Emma Indal Date: Fri, 10 Jun 2022 10:33:29 +0200 Subject: [PATCH] add some more docs to the template body type as well as optional composed_of Signed-off-by: Emma Indal --- .../api-report.md | 3 ++- .../src/engines/ElasticSearchSearchEngine.ts | 17 ++++++++++++++--- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/plugins/search-backend-module-elasticsearch/api-report.md b/plugins/search-backend-module-elasticsearch/api-report.md index a6be34dcb1..dfbb7e493f 100644 --- a/plugins/search-backend-module-elasticsearch/api-report.md +++ b/plugins/search-backend-module-elasticsearch/api-report.md @@ -146,7 +146,8 @@ export type ElasticSearchCustomIndexTemplate = { // @public export type ElasticSearchCustomIndexTemplateBody = { index_patterns: string[]; - template: Record; + composed_of?: string[]; + template?: Record; }; // @public (undocumented) diff --git a/plugins/search-backend-module-elasticsearch/src/engines/ElasticSearchSearchEngine.ts b/plugins/search-backend-module-elasticsearch/src/engines/ElasticSearchSearchEngine.ts index a4b3be6eec..01bffdfff2 100644 --- a/plugins/search-backend-module-elasticsearch/src/engines/ElasticSearchSearchEngine.ts +++ b/plugins/search-backend-module-elasticsearch/src/engines/ElasticSearchSearchEngine.ts @@ -50,10 +50,21 @@ export type ElasticSearchCustomIndexTemplate = { * @public */ export type ElasticSearchCustomIndexTemplateBody = { + /** + * Array of wildcard (*) expressions used to match the names of data streams and indices during creation. + */ index_patterns: string[]; - // See available properties of template - // https://www.elastic.co/guide/en/elasticsearch/reference/7.15/indices-put-template.html#put-index-template-api-request-body - template: Record; + /** + * An ordered list of component template names. + * Component templates are merged in the order specified, + * meaning that the last component template specified has the highest precedence. + */ + composed_of?: string[]; + /** + * See available properties of template + * https://www.elastic.co/guide/en/elasticsearch/reference/7.15/indices-put-template.html#put-index-template-api-request-body + */ + template?: Record; }; /**