Skip to content

Commit 1c9c756

Browse files
committed
Remove matchAppender
1 parent b87fd55 commit 1c9c756

File tree

1 file changed

+1
-18
lines changed

1 file changed

+1
-18
lines changed

x-pack/plugin/esql/compute/src/main/java/org/elasticsearch/compute/lucene/LuceneQueryEvaluator.java

Lines changed: 1 addition & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -266,7 +266,6 @@ Block scoreDense(T scoreBuilder, int min, int max, int positionCount) throws IOE
266266
scoreBuilder,
267267
ctx,
268268
LuceneQueryEvaluator.this::appendNoMatch,
269-
(builder, scorer1, docId, ctc, query) -> LuceneQueryEvaluator.this.appendMatch(builder, scorer1),
270269
weight.getQuery()
271270
)
272271
) {
@@ -322,11 +321,6 @@ private void scoreSingleDocWithScorer(T builder, int doc) throws IOException {
322321
}
323322
}
324323

325-
@FunctionalInterface
326-
public interface MatchAppender<T, U, E extends Exception> {
327-
void accept(T t, U u, int docId, LeafReaderContext leafReaderContext, Query query) throws E;
328-
}
329-
330324
/**
331325
* Collects matching information for dense range of doc ids. This assumes that
332326
* doc ids are sent to {@link LeafCollector#collect(int)} in ascending order
@@ -337,27 +331,17 @@ static class DenseCollector<U extends Block.Builder> implements LeafCollector, R
337331
private final int max;
338332
private final LeafReaderContext leafReaderContext;
339333
private final Consumer<U> appendNoMatch;
340-
private final MatchAppender<U, Scorable, IOException> appendMatch;
341334
private final Query query;
342335

343336
private Scorable scorer;
344337
int next;
345338

346-
DenseCollector(
347-
int min,
348-
int max,
349-
U scoreBuilder,
350-
LeafReaderContext leafReaderContext,
351-
Consumer<U> appendNoMatch,
352-
MatchAppender<U, Scorable, IOException> appendMatch,
353-
Query query
354-
) {
339+
DenseCollector(int min, int max, U scoreBuilder, LeafReaderContext leafReaderContext, Consumer<U> appendNoMatch, Query query) {
355340
this.scoreBuilder = scoreBuilder;
356341
this.max = max;
357342
next = min;
358343
this.leafReaderContext = leafReaderContext;
359344
this.appendNoMatch = appendNoMatch;
360-
this.appendMatch = appendMatch;
361345
this.query = query;
362346
}
363347

@@ -371,7 +355,6 @@ public void collect(int doc) throws IOException {
371355
while (next++ < doc) {
372356
appendNoMatch.accept(scoreBuilder);
373357
}
374-
appendMatch.accept(scoreBuilder, scorer, doc, leafReaderContext, query);
375358
}
376359

377360
public Block build() {

0 commit comments

Comments
 (0)