Skip to content

Commit 27ae9a1

Browse files
committed
[DOCS] Remove outdated file scripts refererence (elastic#50437)
File scripts were removed in 6.0 with elastic#24627. This removes an outdated file scripts reference from the conditional clauses section of the search templates docs.
1 parent c3c9ccf commit 27ae9a1

File tree

1 file changed

+4
-9
lines changed

1 file changed

+4
-9
lines changed

docs/reference/search/search-template.asciidoc

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -545,8 +545,8 @@ The `params` would look like:
545545
// NOTCONSOLE
546546
<1> The `line_no`, `start`, and `end` parameters are optional.
547547

548-
549-
We could write the query as:
548+
When written as a query, the template would include invalid JSON, such as
549+
section markers like `{{#line_no}}`:
550550

551551
[source,js]
552552
------------------------------------------
@@ -587,19 +587,14 @@ We could write the query as:
587587
<6> Include the `lte` clause only if `line_no.end` is specified
588588
<7> Fill in the value of param `line_no.end`
589589

590-
[NOTE]
591-
==================================
592-
As written above, this template is not valid JSON because it includes the
593-
_section_ markers like `{{#line_no}}`. For this reason, the template should
594-
either be stored in a file (see <<pre-registered-templates>>) or, when used
595-
via the REST API, should be written as a string:
590+
Because search templates cannot include invalid JSON, you can pass the same
591+
query as a string instead:
596592

597593
[source,js]
598594
--------------------
599595
"source": "{\"query\":{\"bool\":{\"must\":{\"match\":{\"line\":\"{{text}}\"}},\"filter\":{{{#line_no}}\"range\":{\"line_no\":{{{#start}}\"gte\":\"{{start}}\"{{#end}},{{/end}}{{/start}}{{#end}}\"lte\":\"{{end}}\"{{/end}}}}{{/line_no}}}}}}"
600596
--------------------
601597
// NOTCONSOLE
602-
==================================
603598

604599

605600
[[search-template-encode-urls]]

0 commit comments

Comments
 (0)