Skip to content

Commit e315a92

Browse files
cbuescherdakrone
authored andcommitted
Remove Scorable#docID implementations
This method was removed in apache/lucene#12407 so we also need to remove it in implementations of Scorable.
1 parent 8929005 commit e315a92

File tree

7 files changed

+2
-49
lines changed

7 files changed

+2
-49
lines changed

modules/lang-painless/src/test/java/org/elasticsearch/painless/ScriptedMetricAggContextsTests.java

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -73,11 +73,6 @@ public void testMapBasic() throws IOException {
7373
Map<String, Object> state = new HashMap<>();
7474

7575
Scorable scorer = new Scorable() {
76-
@Override
77-
public int docID() {
78-
return 0;
79-
}
80-
8176
@Override
8277
public float score() {
8378
return 0.5f;

modules/parent-join/src/main/java/org/elasticsearch/join/aggregations/ParentJoinAggregator.java

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -133,11 +133,6 @@ protected void prepareSubAggs(long[] ordsToCollect) throws IOException {
133133
public float score() {
134134
return 1f;
135135
}
136-
137-
@Override
138-
public int docID() {
139-
return childDocsIter.docID();
140-
}
141136
});
142137

143138
final Bits liveDocs = ctx.reader().getLiveDocs();

server/src/main/java/org/elasticsearch/search/aggregations/bucket/nested/NestedAggregator.java

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -206,19 +206,12 @@ void processBufferedChildBuckets() throws IOException {
206206
}
207207

208208
private static class CachedScorable extends Scorable {
209-
int doc;
210209
float score;
211210

212211
@Override
213212
public final float score() {
214213
return score;
215214
}
216-
217-
@Override
218-
public int docID() {
219-
return doc;
220-
}
221-
222215
}
223216

224217
}

server/src/main/java/org/elasticsearch/search/aggregations/bucket/sampler/BestDocsDeferringCollector.java

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,6 @@ class PerSegmentCollects extends Scorable {
213213
private final AggregationExecutionContext aggCtx;
214214
int maxDocId = Integer.MIN_VALUE;
215215
private float currentScore;
216-
private int currentDocId = -1;
217216
private Scorable currentScorer;
218217

219218
PerSegmentCollects(AggregationExecutionContext aggCtx) throws IOException {
@@ -248,7 +247,6 @@ public void replayRelatedMatches(List<ScoreDoc> sd) throws IOException {
248247
leafCollector.setScorer(this);
249248

250249
currentScore = 0;
251-
currentDocId = -1;
252250
if (maxDocId < 0) {
253251
return;
254252
}
@@ -258,7 +256,6 @@ public void replayRelatedMatches(List<ScoreDoc> sd) throws IOException {
258256
int rebased = scoreDoc.doc - aggCtx.getLeafReaderContext().docBase;
259257
if ((rebased >= 0) && (rebased <= maxDocId)) {
260258
currentScore = scoreDoc.score;
261-
currentDocId = rebased;
262259
// We stored the bucket ID in Lucene's shardIndex property
263260
// for convenience.
264261
leafCollector.collect(rebased, scoreDoc.shardIndex);
@@ -275,11 +272,6 @@ public float score() throws IOException {
275272
return currentScore;
276273
}
277274

278-
@Override
279-
public int docID() {
280-
return currentDocId;
281-
}
282-
283275
public void collect(int docId, long parentBucket) throws IOException {
284276
perBucketSamples = bigArrays.grow(perBucketSamples, parentBucket + 1);
285277
PerParentBucketSamples sampler = perBucketSamples.get((int) parentBucket);

server/src/test/java/org/elasticsearch/search/aggregations/MultiBucketCollectorTests.java

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -32,14 +32,8 @@
3232
import static org.hamcrest.Matchers.equalTo;
3333

3434
public class MultiBucketCollectorTests extends ESTestCase {
35-
private static class ScoreAndDoc extends Scorable {
35+
private static class Score extends Scorable {
3636
float score;
37-
int doc = -1;
38-
39-
@Override
40-
public int docID() {
41-
return doc;
42-
}
4337

4438
@Override
4539
public float score() {
@@ -246,7 +240,7 @@ public void testSetScorerAfterCollectionTerminated() throws IOException {
246240
collector1 = new TerminateAfterBucketCollector(collector1, 1);
247241
collector2 = new TerminateAfterBucketCollector(collector2, 2);
248242

249-
Scorable scorer = new ScoreAndDoc();
243+
Scorable scorer = new Score();
250244

251245
List<BucketCollector> collectors = Arrays.asList(collector1, collector2);
252246
Collections.shuffle(collectors, random());

server/src/test/java/org/elasticsearch/search/query/QueryPhaseCollectorTests.java

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1138,11 +1138,6 @@ public void testSetScorerAfterCollectionTerminated() throws IOException {
11381138
public float score() {
11391139
return 0;
11401140
}
1141-
1142-
@Override
1143-
public int docID() {
1144-
return 0;
1145-
}
11461141
};
11471142

11481143
QueryPhaseCollector queryPhaseCollector = new QueryPhaseCollector(
@@ -1472,11 +1467,6 @@ public float score() throws IOException {
14721467
return 0;
14731468
}
14741469

1475-
@Override
1476-
public int docID() {
1477-
return 0;
1478-
}
1479-
14801470
@Override
14811471
public void setMinCompetitiveScore(float minScore) {
14821472
setMinCompetitiveScoreCalled = true;

server/src/test/java/org/elasticsearch/search/sort/BucketedSortForFloatsTests.java

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -120,18 +120,12 @@ public void testScorer() throws IOException {
120120
}
121121

122122
private class MockScorable extends Scorable {
123-
private int doc;
124123
private float score;
125124

126125
@Override
127126
public float score() throws IOException {
128127
return score;
129128
}
130-
131-
@Override
132-
public int docID() {
133-
return doc;
134-
}
135129
}
136130

137131
/**

0 commit comments

Comments
 (0)