diff --git a/modules/lang-expression/src/main/java/org/elasticsearch/script/expression/ExpressionSearchScript.java b/modules/lang-expression/src/main/java/org/elasticsearch/script/expression/ExpressionSearchScript.java index cb19a604623ab..6df2b33127de4 100644 --- a/modules/lang-expression/src/main/java/org/elasticsearch/script/expression/ExpressionSearchScript.java +++ b/modules/lang-expression/src/main/java/org/elasticsearch/script/expression/ExpressionSearchScript.java @@ -25,7 +25,6 @@ import org.apache.lucene.index.LeafReaderContext; import org.apache.lucene.search.DoubleValues; import org.apache.lucene.search.DoubleValuesSource; -import org.apache.lucene.search.Scorer; import org.elasticsearch.script.GeneralScriptException; import org.elasticsearch.script.SearchScript; @@ -42,8 +41,6 @@ class ExpressionSearchScript implements SearchScript.LeafFactory { final DoubleValuesSource source; final ReplaceableConstDoubleValueSource specialValue; // _value final boolean needsScores; - Scorer scorer; - int docid; ExpressionSearchScript(Expression e, SimpleBindings b, ReplaceableConstDoubleValueSource v, boolean needsScores) { exprScript = e; diff --git a/server/src/main/java/org/elasticsearch/script/ScriptType.java b/server/src/main/java/org/elasticsearch/script/ScriptType.java index 2fdf283c57fb4..5d356bbd7cbcc 100644 --- a/server/src/main/java/org/elasticsearch/script/ScriptType.java +++ b/server/src/main/java/org/elasticsearch/script/ScriptType.java @@ -41,7 +41,7 @@ public enum ScriptType implements Writeable { * (Groovy and others), but can be overridden by the specific {@link ScriptEngine} * if the language is naturally secure (Painless, Mustache, and Expressions). */ - INLINE ( 0 , new ParseField("source", "inline") , false ), + INLINE ( 0 , new ParseField("source", "inline")), /** * STORED scripts are saved as part of the {@link org.elasticsearch.cluster.ClusterState} @@ -50,7 +50,7 @@ public enum ScriptType implements Writeable { * (Groovy and others), but can be overridden by the specific {@link ScriptEngine} * if the language is naturally secure (Painless, Mustache, and Expressions). */ - STORED ( 1 , new ParseField("id", "stored") , false ); + STORED ( 1 , new ParseField("id", "stored")); /** * Reads an int from the input stream and converts it to a {@link ScriptType}. @@ -73,18 +73,15 @@ public static ScriptType readFrom(StreamInput in) throws IOException { private final int id; private final ParseField parseField; - private final boolean defaultEnabled; /** * Standard constructor. * @param id A unique identifier for a type that can be read/written to a stream. * @param parseField Specifies the name used to parse input from queries. - * @param defaultEnabled Whether or not a {@link ScriptType} can be run by default. */ - ScriptType(int id, ParseField parseField, boolean defaultEnabled) { + ScriptType(int id, ParseField parseField) { this.id = id; this.parseField = parseField; - this.defaultEnabled = defaultEnabled; } public void writeTo(StreamOutput out) throws IOException { @@ -112,14 +109,6 @@ public ParseField getParseField() { return parseField; } - /** - * @return Whether or not a {@link ScriptType} can be run by default. Note - * this can be potentially overridden by any {@link ScriptEngine}. - */ - public boolean isDefaultEnabled() { - return defaultEnabled; - } - /** * @return The same as calling {@link #getName()}. */