84 | * Ref: http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/modules-scripting.html 85 | */ 86 | public UpdateByQueryRequestBuilder setScriptLang(String lang) { 87 | sourceBuilder().scriptLang(lang); 88 | return this; 89 | } 90 | 91 | /** 92 | * The inline script to execute. 93 | * @see #setScript(String, ScriptService.ScriptType) 94 | */ 95 | public UpdateByQueryRequestBuilder setScript(String script) { 96 | return setScript(script, ScriptType.INLINE); 97 | } 98 | 99 | /** 100 | * The script to execute. Note, make sure not to send different script each times and instead 101 | * use script params if possible with the same (automatically compiled) script. 102 | *
103 | * The script works with the variable
71 | * The script works with the variable
88 | * Ref: http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/modules-scripting.html
89 | */
90 | public UpdateByQuerySourceBuilder scriptLang(String scriptLang) {
91 | this.scriptLang = scriptLang;
92 | return this;
93 | }
94 |
95 | /**
96 | * Sets the script parameters to use with the script.
97 | */
98 | public UpdateByQuerySourceBuilder scriptParams(Mapctx
, which is bound to the entry,
104 | * e.g. ctx._source.mycounter += 1
.
105 | *
106 | * @see #setScriptLang(String)
107 | * @see #setScriptParams(Map)
108 | */
109 | public UpdateByQueryRequestBuilder setScript(String script, ScriptType scriptType) {
110 | sourceBuilder().script(script, scriptType);
111 | return this;
112 | }
113 |
114 | /**
115 | * Sets the script parameters to use with the script.
116 | */
117 | public UpdateByQueryRequestBuilder setScriptParams(Mapctx
, which is bound to the entry,
72 | * e.g. ctx._source.mycounter += 1
.
73 | *
74 | * @see #scriptLang(String)
75 | * @see #scriptParams(Map)
76 | */
77 | public UpdateByQuerySourceBuilder script(String script, ScriptType scriptType) {
78 | this.script = script;
79 | this.scriptType = scriptType;
80 | return this;
81 | }
82 |
83 | /**
84 | * The language of the script to execute.
85 | * Valid options are: mvel, js, groovy, python, and native (Java)
86 | * Default: groovy
87 | *