[DOCS] Add template docs to scripts. Reorder template examples. (#45817)

* [DOCS] Add template docs to scripts. Reorder template examples.

* Adds a 'Search template' section to the 'How to use scripts' chapter.
  This links to the 'Search template' chapter for detailed info and
  examples.

* Reorders and retitles several examples in the 'Search template'
  chapter. This is primarily to make examples for storing, deleting, and
  using search templates more prominent.

* Change <templatename> to <templateid>
This commit is contained in:
James Rodewig 2019-08-22 08:40:09 -04:00 committed by GitHub
parent 77267adc84
commit 26323f0db3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 218 additions and 199 deletions

View file

@ -195,6 +195,21 @@ DELETE _scripts/calculate-score
// CONSOLE
// TEST[continued]
[float]
[[modules-scripting-search-templates]]
=== Search templates
You can also use the `_scripts` API to store **search templates**. Search
templates save specific <<search-search,search requests>> with placeholder
values, called template parameters.
You can use stored search templates to run searches without writing out the
entire query. Just provide the stored template's ID and the template parameters.
This is useful when you want to run a commonly used query quickly and without
mistakes.
Search templates use the http://mustache.github.io/mustache.5.html[mustache
templating language]. See <<search-template>> for more information and examples.
[float]
[[modules-scripting-using-caching]]
=== Script caching