mirror of https://github.com/apache/lucene.git
fix per-segment test bug
git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1144236 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
e94f5fcc99
commit
255ae3e9bf
|
@ -47,13 +47,12 @@ public class TestSpanQueryFilter extends LuceneTestCase {
|
|||
writer.close();
|
||||
AtomicReaderContext[] leaves = ReaderUtil.leaves(reader.getTopReaderContext());
|
||||
int subIndex = ReaderUtil.subIndex(number, leaves); // find the reader with this document in it
|
||||
|
||||
SpanTermQuery query = new SpanTermQuery(new Term("field", English.intToEnglish(number).trim()));
|
||||
SpanQueryFilter filter = new SpanQueryFilter(query);
|
||||
SpanFilterResult result = filter.bitSpans(leaves[subIndex]);
|
||||
DocIdSet docIdSet = result.getDocIdSet();
|
||||
assertTrue("docIdSet is null and it shouldn't be", docIdSet != null);
|
||||
assertContainsDocId("docIdSet doesn't contain docId 10", docIdSet, number);
|
||||
assertContainsDocId("docIdSet doesn't contain docId 10", docIdSet, number - leaves[subIndex].docBase);
|
||||
List<SpanFilterResult.PositionInfo> spans = result.getPositions();
|
||||
assertTrue("spans is null and it shouldn't be", spans != null);
|
||||
int size = getDocIdSetSize(docIdSet);
|
||||
|
|
Loading…
Reference in New Issue