mirror of https://github.com/apache/lucene.git
Fix failing unit test - TestTopDocsCollector#testResultsOrder (#13621)
This commit is contained in:
parent
ad2f02c013
commit
1ce1156de4
|
@ -72,9 +72,6 @@ public class TestTopDocsCollector extends LuceneTestCase {
|
|||
}
|
||||
|
||||
private static final class MyTopDocsCollector extends TopDocsCollector<ScoreDoc> {
|
||||
|
||||
private int idx = 0;
|
||||
|
||||
public MyTopDocsCollector(int size) {
|
||||
super(new HitQueue(size, false));
|
||||
}
|
||||
|
@ -92,11 +89,12 @@ public class TestTopDocsCollector extends LuceneTestCase {
|
|||
public LeafCollector getLeafCollector(LeafReaderContext context) throws IOException {
|
||||
final int base = context.docBase;
|
||||
return new LeafCollector() {
|
||||
private int idx = 0;
|
||||
|
||||
@Override
|
||||
public void collect(int doc) {
|
||||
++totalHits;
|
||||
pq.insertWithOverflow(new ScoreDoc(doc + base, scores[idx++]));
|
||||
pq.insertWithOverflow(new ScoreDoc(doc + base, scores[context.docBase + idx++]));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
Loading…
Reference in New Issue