Skip to content

Commit

Permalink
MINOR: Remove Dead Code in SearchScript (#33569) (#33594)
Browse files Browse the repository at this point in the history
* `lookup` is not used anywhere
* `getLeafContext` is not used anywhere
  • Loading branch information
original-brownbear authored Sep 13, 2018
1 parent 345899e commit 3414c3a
Showing 1 changed file with 0 additions and 13 deletions.
13 changes: 0 additions & 13 deletions server/src/main/java/org/elasticsearch/script/SearchScript.java
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,6 @@ public abstract class SearchScript implements ScorerAware, ExecutableScript {
/** The generic runtime parameters for the script. */
private final Map<String, Object> params;

/** A lookup for the index this script will operate on. */
private final SearchLookup lookup;

/** A leaf lookup for the bound segment this script will operate on. */
private final LeafReaderContext leafContext;

/** A leaf lookup for the bound segment this script will operate on. */
private final LeafSearchLookup leafLookup;

Expand All @@ -60,8 +54,6 @@ public abstract class SearchScript implements ScorerAware, ExecutableScript {

public SearchScript(Map<String, Object> params, SearchLookup lookup, LeafReaderContext leafContext) {
this.params = params;
this.lookup = lookup;
this.leafContext = leafContext;
// TODO: remove leniency when painless does not implement SearchScript for executable script cases
this.leafLookup = leafContext == null ? null : lookup.getLeafSearchLookup(leafContext);
}
Expand All @@ -76,11 +68,6 @@ protected final LeafSearchLookup getLeafLookup() {
return leafLookup;
}

/** The leaf context for the Lucene segment this script was created for. */
protected final LeafReaderContext getLeafContext() {
return leafContext;
}

/** The doc lookup for the Lucene segment this script was created for. */
public final LeafDocLookup getDoc() {
// TODO: remove leniency when painless does not implement SearchScript for executable script cases
Expand Down

0 comments on commit 3414c3a

Please sign in to comment.