Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Script: Remove FieldAccess #76109

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,8 @@

# The whitelist for the fields api

# The scripts must be whitelisted for painless to find the classes
# The scripts must be whitelisted for painless to find the classes for the field API
class org.elasticsearch.script.NumberSortScript @no_import {
}
class org.elasticsearch.script.NumberSortScript$Factory @no_import {
}

# Class bindings
static_import {
org.elasticsearch.script.Field field(org.elasticsearch.script.NumberSortScript, String) bound_to org.elasticsearch.script.NumberSortScript$FieldAccess
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,8 @@

# The whitelist for the fields api

# The scripts must be whitelisted for painless to find the classes
# The scripts must be whitelisted for painless to find the classes for the field API
class org.elasticsearch.script.ScoreScript @no_import {
}
class org.elasticsearch.script.ScoreScript$Factory @no_import {
}

# Class bindings
static_import {
org.elasticsearch.script.Field field(org.elasticsearch.script.ScoreScript, String) bound_to org.elasticsearch.script.ScoreScript$FieldAccess
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,8 @@
#

# The whitelist for the fields api
# The scripts must be whitelisted for painless to find the classes
# The scripts must be whitelisted for painless to find the classes for the field API
class org.elasticsearch.script.StringSortScript @no_import {
}
class org.elasticsearch.script.StringSortScript$Factory @no_import {
}

# Class bindings
static_import {
org.elasticsearch.script.Field field(org.elasticsearch.script.StringSortScript, String) bound_to org.elasticsearch.script.StringSortScript$FieldAccess
}
12 changes: 0 additions & 12 deletions server/src/main/java/org/elasticsearch/script/DocBasedScript.java
Original file line number Diff line number Diff line change
Expand Up @@ -60,16 +60,4 @@ public Map<String, ScriptDocValues<?>> getDoc() {
}
return docReader.doc();
}

public static class FieldAccess {
private final DocBasedScript script;

public FieldAccess(DocBasedScript script) {
this.script = script;
}

public Field<?> field(String fieldName) {
return script.field(fieldName);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -49,16 +49,4 @@ public interface Factory extends ScriptFactory {
// in LeafFactory.newInstance to set fallbacks.
LeafFactory newFactory(Map<String, Object> params, SearchLookup searchLookup);
}

public static class FieldAccess {
private final NumberSortScript script;

public FieldAccess(NumberSortScript script) {
this.script = script;
}

public Field<?> field(String fieldName) {
return script.field(fieldName);
}
}
}
12 changes: 0 additions & 12 deletions server/src/main/java/org/elasticsearch/script/ScoreScript.java
Original file line number Diff line number Diff line change
Expand Up @@ -207,16 +207,4 @@ public interface Factory extends ScriptFactory {
}

public static final ScriptContext<ScoreScript.Factory> CONTEXT = new ScriptContext<>("score", ScoreScript.Factory.class);

public static class FieldAccess {
private final ScoreScript script;

public FieldAccess(ScoreScript script) {
this.script = script;
}

public Field<?> field(String fieldName) {
return script.field(fieldName);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -35,16 +35,4 @@ public interface LeafFactory {
public interface Factory extends ScriptFactory {
LeafFactory newFactory(Map<String, Object> params);
}

public static class FieldAccess {
private final StringSortScript script;

public FieldAccess(StringSortScript script) {
this.script = script;
}

public Field<?> field(String fieldName) {
return script.field(fieldName);
}
}
}