Browse Source

Remove extraneous doc id method (#126570)

Removes docId. We can use _getDocId instead of docId instead. They are identical.
Jack Conradson 6 months ago
parent
commit
d081100887

+ 1 - 1
server/src/main/java/org/elasticsearch/common/lucene/search/function/ScriptScoreFunction.java

@@ -64,7 +64,7 @@ public class ScriptScoreFunction extends ScoreFunction {
 
         if (script.needs_termStats()) {
             assert termStatsFactory != null;
-            leafScript._setTermStats(termStatsFactory.apply(ctx, leafScript::docId));
+            leafScript._setTermStats(termStatsFactory.apply(ctx, leafScript::_getDocId));
         }
 
         return new LeafScoreFunction() {

+ 0 - 5
server/src/main/java/org/elasticsearch/script/ScoreScript.java

@@ -116,11 +116,6 @@ public abstract class ScoreScript extends DocBasedScript {
         this.docId = docid;
     }
 
-    /** Get the current document. */
-    public int docId() {
-        return docId;
-    }
-
     public void setScorer(Scorable scorer) {
         this.scoreSupplier = () -> {
             try {