summaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
authorRyan Ernst <ryan@iernst.net>2017-05-25 12:18:45 -0700
committerGitHub <noreply@github.com>2017-05-25 12:18:45 -0700
commit8aaea51a0a0d822e67404e3af6b970e8a323b877 (patch)
tree1d008a9db65c784419fe6edfcb93e365bc103c7e /plugins
parent59c052e76f7428427c8f7e995285bd0b05e82c08 (diff)
Scripting: Move context definitions to instance type classes (#24883)
This is a simple refactoring to move the context definitions into the type that they use. While we have multiple context names for the same class at the moment, this will eventually become one ScriptContext per instance type, so the pattern of a static member on the interface called CONTEXT can be used. This commit also moves the consolidated list of contexts provided by core ES into ScriptModule.
Diffstat (limited to 'plugins')
-rw-r--r--plugins/examples/script-expert-scoring/src/main/java/org/elasticsearch/example/expertscript/ExpertScriptPlugin.java2
1 files changed, 1 insertions, 1 deletions
diff --git a/plugins/examples/script-expert-scoring/src/main/java/org/elasticsearch/example/expertscript/ExpertScriptPlugin.java b/plugins/examples/script-expert-scoring/src/main/java/org/elasticsearch/example/expertscript/ExpertScriptPlugin.java
index 161ac7ff4a..756dba6b68 100644
--- a/plugins/examples/script-expert-scoring/src/main/java/org/elasticsearch/example/expertscript/ExpertScriptPlugin.java
+++ b/plugins/examples/script-expert-scoring/src/main/java/org/elasticsearch/example/expertscript/ExpertScriptPlugin.java
@@ -59,7 +59,7 @@ public class ExpertScriptPlugin extends Plugin implements ScriptPlugin {
@Override
public <T> T compile(String scriptName, String scriptSource, ScriptContext<T> context, Map<String, String> params) {
- if (context.equals(ScriptContext.SEARCH) == false) {
+ if (context.equals(SearchScript.CONTEXT) == false) {
throw new IllegalArgumentException(getType() + " scripts cannot be used for context [" + context.name + "]");
}
// we use the script "source" as the script identifier