mirror of
https://github.com/apache/lucene.git
synced 2025-02-09 03:25:15 +00:00
LUCENE-7055: Make sure to use the same reader to create the weight and pull the scorers.
This commit is contained in:
parent
075aec91cd
commit
e8fa59904c
@ -68,7 +68,7 @@ public class TestIndexOrDocValuesQuery extends LuceneTestCase {
|
|||||||
.build();
|
.build();
|
||||||
|
|
||||||
final Weight w1 = searcher.createNormalizedWeight(q1, random().nextBoolean());
|
final Weight w1 = searcher.createNormalizedWeight(q1, random().nextBoolean());
|
||||||
final Scorer s1 = w1.scorer(reader.leaves().get(0));
|
final Scorer s1 = w1.scorer(searcher.getIndexReader().leaves().get(0));
|
||||||
assertNotNull(s1.twoPhaseIterator()); // means we use doc values
|
assertNotNull(s1.twoPhaseIterator()); // means we use doc values
|
||||||
|
|
||||||
// The term query is less selective, so the IndexOrDocValuesQuery should use points
|
// The term query is less selective, so the IndexOrDocValuesQuery should use points
|
||||||
@ -78,7 +78,7 @@ public class TestIndexOrDocValuesQuery extends LuceneTestCase {
|
|||||||
.build();
|
.build();
|
||||||
|
|
||||||
final Weight w2 = searcher.createNormalizedWeight(q2, random().nextBoolean());
|
final Weight w2 = searcher.createNormalizedWeight(q2, random().nextBoolean());
|
||||||
final Scorer s2 = w2.scorer(reader.leaves().get(0));
|
final Scorer s2 = w2.scorer(searcher.getIndexReader().leaves().get(0));
|
||||||
assertNull(s2.twoPhaseIterator()); // means we use points
|
assertNull(s2.twoPhaseIterator()); // means we use points
|
||||||
|
|
||||||
reader.close();
|
reader.close();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user