LUCENE-2895: MockRandomCodec loads termsIndex even if termsIndexDivisor is set to -1

git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1064926 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Michael McCandless 2011-01-28 23:12:22 +00:00
parent 0d9559e1b4
commit 06c4c204c8
2 changed files with 4 additions and 1 deletions

View File

@ -31,6 +31,7 @@ public class TestSegmentInfo extends LuceneTestCase {
Directory dir = newDirectory();
IndexWriterConfig conf = newIndexWriterConfig(TEST_VERSION_CURRENT, new MockAnalyzer());
IndexWriter writer = new IndexWriter(dir, conf);
writer.setInfoStream(VERBOSE ? System.out : null);
Document doc = new Document();
doc.add(new Field("a", "value", Store.YES, Index.ANALYZED));
writer.addDocument(doc);

View File

@ -260,7 +260,9 @@ public class MockRandomCodec extends Codec {
if (LuceneTestCase.VERBOSE) {
System.out.println("MockRandomCodec: variable-gap terms index (divisor=" + state.termsIndexDivisor + ")");
}
state.termsIndexDivisor = _TestUtil.nextInt(random, 1, 10);
if (state.termsIndexDivisor != -1) {
state.termsIndexDivisor = _TestUtil.nextInt(random, 1, 10);
}
indexReader = new VariableGapTermsIndexReader(state.dir,
state.fieldInfos,
state.segmentInfo.name,