Skip to content

Commit

Permalink
[DOCS] Add template docs to scripts. Reorder template examples. (#45817)
Browse files Browse the repository at this point in the history
* [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>
  • Loading branch information
jrodewig committed Aug 22, 2019
1 parent 5ec7c85 commit 9d53d64
Show file tree
Hide file tree
Showing 2 changed files with 218 additions and 199 deletions.
15 changes: 15 additions & 0 deletions docs/reference/scripting/using.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading

0 comments on commit 9d53d64

Please sign in to comment.