Skip to content

Commit 26323f0

Browse files
authored
[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>
1 parent 77267ad commit 26323f0

File tree

2 files changed

+218
-199
lines changed

2 files changed

+218
-199
lines changed

docs/reference/scripting/using.asciidoc

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -195,6 +195,21 @@ DELETE _scripts/calculate-score
195195
// CONSOLE
196196
// TEST[continued]
197197

198+
[float]
199+
[[modules-scripting-search-templates]]
200+
=== Search templates
201+
You can also use the `_scripts` API to store **search templates**. Search
202+
templates save specific <<search-search,search requests>> with placeholder
203+
values, called template parameters.
204+
205+
You can use stored search templates to run searches without writing out the
206+
entire query. Just provide the stored template's ID and the template parameters.
207+
This is useful when you want to run a commonly used query quickly and without
208+
mistakes.
209+
210+
Search templates use the http://mustache.github.io/mustache.5.html[mustache
211+
templating language]. See <<search-template>> for more information and examples.
212+
198213
[float]
199214
[[modules-scripting-using-caching]]
200215
=== Script caching

0 commit comments

Comments
 (0)