diff options
Diffstat (limited to 'modules/lang-mustache/src/main/java/org/elasticsearch')
-rw-r--r-- | modules/lang-mustache/src/main/java/org/elasticsearch/script/mustache/TransportSearchTemplateAction.java | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/modules/lang-mustache/src/main/java/org/elasticsearch/script/mustache/TransportSearchTemplateAction.java b/modules/lang-mustache/src/main/java/org/elasticsearch/script/mustache/TransportSearchTemplateAction.java index d7b0406238..61f099f6c2 100644 --- a/modules/lang-mustache/src/main/java/org/elasticsearch/script/mustache/TransportSearchTemplateAction.java +++ b/modules/lang-mustache/src/main/java/org/elasticsearch/script/mustache/TransportSearchTemplateAction.java @@ -34,6 +34,7 @@ import org.elasticsearch.common.xcontent.XContentFactory; import org.elasticsearch.common.xcontent.XContentParser; import org.elasticsearch.common.xcontent.XContentType; import org.elasticsearch.index.query.QueryParseContext; +import org.elasticsearch.script.CompiledScript; import org.elasticsearch.script.ExecutableScript; import org.elasticsearch.script.Script; import org.elasticsearch.script.ScriptService; @@ -71,7 +72,8 @@ public class TransportSearchTemplateAction extends HandledTransportAction<Search try { Script script = new Script(request.getScriptType(), TEMPLATE_LANG, request.getScript(), request.getScriptParams() == null ? Collections.emptyMap() : request.getScriptParams()); - ExecutableScript executable = scriptService.executable(script, SEARCH); + CompiledScript compiledScript = scriptService.compile(script, SEARCH); + ExecutableScript executable = scriptService.executable(compiledScript, script.getParams()); BytesReference source = (BytesReference) executable.run(); response.setSource(source); |