Skip to content

Commit

Permalink
[DOCS] Remove outdated file scripts refererence (#50437)
Browse files Browse the repository at this point in the history
File scripts were removed in 6.0 with #24627.

This removes an outdated file scripts reference from the conditional clauses section of the search templates docs.
  • Loading branch information
jrodewig authored Dec 20, 2019
1 parent 75a5a0b commit a311018
Showing 1 changed file with 4 additions and 9 deletions.
13 changes: 4 additions & 9 deletions docs/reference/search/search-template.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -545,8 +545,8 @@ The `params` would look like:
// NOTCONSOLE
<1> The `line_no`, `start`, and `end` parameters are optional.


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

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

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

[source,js]
--------------------
"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}}}}}}"
--------------------
// NOTCONSOLE
==================================


[[search-template-encode-urls]]
Expand Down

0 comments on commit a311018

Please sign in to comment.