mirror of
https://github.com/elastic/elasticsearch.git
synced 2025-04-25 07:37:19 -04:00
[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:
parent
77267adc84
commit
26323f0db3
2 changed files with 218 additions and 199 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue