File tree Expand file tree Collapse file tree 2 files changed +27
-6
lines changed Expand file tree Collapse file tree 2 files changed +27
-6
lines changed Original file line number Diff line number Diff line change @@ -98,8 +98,8 @@ parameter in the same way as the search api.
9898So far we've only been updating documents without changing their source. That
9999is genuinely useful for things like
100100<<picking-up-a-new-property,picking up new properties>> but it's only half the
101- fun. `_update_by_query` supports a `script` object to update the document. This
102- will increment the `likes` field on all of kimchy's tweets:
101+ fun. `_update_by_query` <<modules-scripting-using, supports scripts>> to update
102+ the document. This will increment the `likes` field on all of kimchy's tweets:
103103
104104[source,js]
105105--------------------------------------------------
Original file line number Diff line number Diff line change @@ -49,10 +49,7 @@ GET my_index/_search
4949
5050`lang`::
5151
52- Specifies the language the script is written in. Defaults to `painless` but
53- may be set to any of languages listed in <<modules-scripting>>. The
54- default language may be changed in the `elasticsearch.yml` config file by
55- setting `script.default_lang` to the appropriate language.
52+ Specifies the language the script is written in. Defaults to `painless`.
5653
5754
5855`source`, `id`::
@@ -108,6 +105,30 @@ minute will be compiled. You can change this setting dynamically by setting
108105
109106========================================
110107
108+ [float]
109+ [[modules-scripting-short-script-form]]
110+ === Short Script Form
111+ A short script form can be used for brevity. In the short form, `script` is represented
112+ by a string instead of an object. This string contains the source of the script.
113+
114+ Short form:
115+
116+ [source,js]
117+ ----------------------
118+ "script": "ctx._source.likes++"
119+ ----------------------
120+ // NOTCONSOLE
121+
122+ The same script in the normal form:
123+
124+ [source,js]
125+ ----------------------
126+ "script": {
127+ "source": "ctx._source.likes++"
128+ }
129+ ----------------------
130+ // NOTCONSOLE
131+
111132[float]
112133[[modules-scripting-stored-scripts]]
113134=== Stored Scripts
You can’t perform that action at this time.
0 commit comments