Skip to content

Commit 2de919e

Browse files
committed
[DOCS] Move 'Scripting' section to top-level navigation. (elastic#42939)
1 parent e35b240 commit 2de919e

9 files changed

+26
-33
lines changed

docs/reference/index.asciidoc

+2
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,8 @@ include::cluster.asciidoc[]
4343

4444
include::query-dsl.asciidoc[]
4545

46+
include::scripting.asciidoc[]
47+
4648
include::mapping.asciidoc[]
4749

4850
include::analysis.asciidoc[]

docs/reference/modules.asciidoc

-12
Original file line numberDiff line numberDiff line change
@@ -46,20 +46,10 @@ The modules in this section are:
4646

4747
A Java node client joins the cluster, but doesn't hold data or act as a master node.
4848

49-
<<modules-scripting-painless,Painless>>::
50-
51-
A built-in scripting language for Elasticsearch that's designed to be as secure as possible.
52-
5349
<<modules-plugins,Plugins>>::
5450

5551
Using plugins to extend Elasticsearch.
5652

57-
<<modules-scripting,Scripting>>::
58-
59-
Custom scripting available in Lucene Expressions, ad Groovy. You can also
60-
write scripts in the built-in scripting language,
61-
<<modules-scripting-painless, Painless>>.
62-
6353
<<modules-snapshots,Snapshot/Restore>>::
6454

6555
Backup your data with snapshot/restore.
@@ -102,8 +92,6 @@ include::modules/node.asciidoc[]
10292
:edit_url:
10393
include::modules/plugins.asciidoc[]
10494

105-
include::modules/scripting.asciidoc[]
106-
10795
include::modules/snapshots.asciidoc[]
10896

10997
include::modules/threadpool.asciidoc[]

docs/reference/modules/scripting.asciidoc renamed to docs/reference/scripting.asciidoc

+9-7
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,19 @@
11
[[modules-scripting]]
2-
== Scripting
2+
= Scripting
33

4-
The scripting module enables you to use scripts to evaluate custom
5-
expressions. For example, you could use a script to return "script fields"
6-
as part of a search request or evaluate a custom score for a query.
4+
[partintro]
5+
--
6+
With scripting, you can evaluate custom expressions in {es}. For example, you
7+
could use a script to return "script fields" as part of a search request or
8+
evaluate a custom score for a query.
79

810
The default scripting language is <<modules-scripting-painless, `Painless`>>.
911
Additional `lang` plugins enable you to run scripts written in other languages.
1012
Everywhere a script can be used, you can include a `lang` parameter
1113
to specify the language of the script.
1214

1315
[float]
14-
=== General-purpose languages:
16+
== General-purpose languages
1517

1618
These languages can be used for any purpose in the scripting APIs,
1719
and give the most flexibility.
@@ -29,7 +31,7 @@ and give the most flexibility.
2931
|=======================================================================
3032

3133
[float]
32-
=== Special-purpose languages:
34+
== Special-purpose languages
3335

3436
These languages are less flexible, but typically have higher performance for
3537
certain tasks.
@@ -67,7 +69,7 @@ sandboxed languages can be a security issue, please read
6769
<<modules-scripting-security, Scripting and security>> for more details.
6870
6971
=================================================
70-
72+
--
7173

7274
include::scripting/using.asciidoc[]
7375

docs/reference/modules/scripting/engine.asciidoc renamed to docs/reference/scripting/engine.asciidoc

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[[modules-scripting-engine]]
2-
=== Advanced scripts using script engines
2+
== Advanced scripts using script engines
33

44
A `ScriptEngine` is a backend for implementing a scripting language. It may also
55
be used to write scripts that need to use advanced internals of scripting. For example,

docs/reference/modules/scripting/expression.asciidoc renamed to docs/reference/scripting/expression.asciidoc

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[[modules-scripting-expression]]
2-
=== Lucene Expressions Language
2+
== Lucene expressions language
33

44
Lucene's expressions compile a `javascript` expression to bytecode. They are
55
designed for high-performance custom ranking and sorting functions and are

docs/reference/modules/scripting/fields.asciidoc renamed to docs/reference/scripting/fields.asciidoc

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[[modules-scripting-fields]]
2-
=== Accessing document fields and special variables
2+
== Accessing document fields and special variables
33

44
Depending on where a script is used, it will have access to certain special
55
variables and document fields.
@@ -17,7 +17,7 @@ API will have access to the `ctx` variable which exposes:
1717
`ctx._index` etc:: Access to <<mapping-fields,document meta-fields>>, some of which may be read-only.
1818

1919
[float]
20-
== Search and Aggregation scripts
20+
== Search and aggregation scripts
2121

2222
With the exception of <<search-request-script-fields,script fields>> which are
2323
executed once per search hit, scripts used in search and aggregations will be
@@ -80,7 +80,7 @@ GET my_index/_search
8080

8181
[float]
8282
[[modules-scripting-doc-vals]]
83-
=== Doc Values
83+
=== Doc values
8484

8585
By far the fastest most efficient way to access a field value from a
8686
script is to use the `doc['field_name']` syntax, which retrieves the field
@@ -140,7 +140,7 @@ access `text` fields from scripts.
140140

141141
[float]
142142
[[modules-scripting-stored]]
143-
=== Stored Fields and `_source`
143+
=== Stored fields and `_source`
144144

145145
_Stored fields_ -- fields explicitly marked as
146146
<<mapping-store,`"store": true`>> -- can be accessed using the

docs/reference/modules/scripting/painless.asciidoc renamed to docs/reference/scripting/painless.asciidoc

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[[modules-scripting-painless]]
2-
=== Painless Scripting Language
2+
== Painless scripting language
33

44
_Painless_ is a simple, secure scripting language designed specifically for use
55
with Elasticsearch. It is the default scripting language for Elasticsearch and

docs/reference/modules/scripting/security.asciidoc renamed to docs/reference/scripting/security.asciidoc

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[[modules-scripting-security]]
2-
=== Scripting and security
2+
== Scripting and security
33

44
While Elasticsearch contributors make every effort to prevent scripts from
55
running amok, security is something best done in

docs/reference/modules/scripting/using.asciidoc renamed to docs/reference/scripting/using.asciidoc

+7-6
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[[modules-scripting-using]]
2-
=== How to use scripts
2+
== How to use scripts
33

44
Wherever scripting is supported in the Elasticsearch API, the syntax follows
55
the same pattern:
@@ -45,7 +45,7 @@ GET my_index/_search
4545
// CONSOLE
4646

4747
[float]
48-
=== Script Parameters
48+
=== Script parameters
4949

5050
`lang`::
5151

@@ -107,7 +107,7 @@ minute will be compiled. You can change this setting dynamically by setting
107107

108108
[float]
109109
[[modules-scripting-short-script-form]]
110-
=== Short Script Form
110+
=== Short script form
111111
A short script form can be used for brevity. In the short form, `script` is represented
112112
by a string instead of an object. This string contains the source of the script.
113113

@@ -131,12 +131,13 @@ The same script in the normal form:
131131

132132
[float]
133133
[[modules-scripting-stored-scripts]]
134-
=== Stored Scripts
134+
=== Stored scripts
135135

136136
Scripts may be stored in and retrieved from the cluster state using the
137137
`_scripts` end-point.
138138

139-
==== Request Examples
139+
[float]
140+
==== Request examples
140141

141142
The following are examples of using a stored script that lives at
142143
`/_scripts/{id}`.
@@ -196,7 +197,7 @@ DELETE _scripts/calculate-score
196197

197198
[float]
198199
[[modules-scripting-using-caching]]
199-
=== Script Caching
200+
=== Script caching
200201

201202
All scripts are cached by default so that they only need to be recompiled
202203
when updates occur. By default, scripts do not have a time-based expiration, but

0 commit comments

Comments
 (0)