summaryrefslogtreecommitdiff
path: root/core/src/main/java/org/elasticsearch/action/update/UpdateHelper.java
diff options
context:
space:
mode:
Diffstat (limited to 'core/src/main/java/org/elasticsearch/action/update/UpdateHelper.java')
-rw-r--r--core/src/main/java/org/elasticsearch/action/update/UpdateHelper.java4
1 files changed, 3 insertions, 1 deletions
diff --git a/core/src/main/java/org/elasticsearch/action/update/UpdateHelper.java b/core/src/main/java/org/elasticsearch/action/update/UpdateHelper.java
index b1621bc118..09fc0bccbf 100644
--- a/core/src/main/java/org/elasticsearch/action/update/UpdateHelper.java
+++ b/core/src/main/java/org/elasticsearch/action/update/UpdateHelper.java
@@ -43,6 +43,7 @@ import org.elasticsearch.index.mapper.ParentFieldMapper;
import org.elasticsearch.index.mapper.RoutingFieldMapper;
import org.elasticsearch.index.shard.IndexShard;
import org.elasticsearch.index.shard.ShardId;
+import org.elasticsearch.script.CompiledScript;
import org.elasticsearch.script.ExecutableScript;
import org.elasticsearch.script.Script;
import org.elasticsearch.script.ScriptContext;
@@ -213,7 +214,8 @@ public class UpdateHelper extends AbstractComponent {
private Map<String, Object> executeScript(Script script, Map<String, Object> ctx) {
try {
if (scriptService != null) {
- ExecutableScript executableScript = scriptService.executable(script, ScriptContext.Standard.UPDATE);
+ CompiledScript compiledScript = scriptService.compile(script, ScriptContext.Standard.UPDATE);
+ ExecutableScript executableScript = scriptService.executable(compiledScript, script.getParams());
executableScript.setNextVar("ctx", ctx);
executableScript.run();
}