mirror of https://github.com/apache/lucene.git
Make creation of backwards indexes working again (unfortunately in trunk it still has some randomness in MockAnalyzer, added TODO)
git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1144658 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
a3fc708e51
commit
cf6fb18337
|
@ -455,9 +455,12 @@ public class TestBackwardsCompatibility extends LuceneTestCase {
|
|||
File indexDir = new File(LuceneTestCase.TEMP_DIR, dirName);
|
||||
_TestUtil.rmDir(indexDir);
|
||||
Directory dir = newFSDirectory(indexDir);
|
||||
|
||||
IndexWriterConfig conf = new IndexWriterConfig(TEST_VERSION_CURRENT, new MockAnalyzer(random)).setMaxBufferedDocs(10);
|
||||
((LogMergePolicy) conf.getMergePolicy()).setUseCompoundFile(doCFS);
|
||||
LogByteSizeMergePolicy mp = new LogByteSizeMergePolicy();
|
||||
mp.setUseCompoundFile(doCFS);
|
||||
mp.setNoCFSRatio(1.0);
|
||||
// TODO: remove randomness
|
||||
IndexWriterConfig conf = new IndexWriterConfig(TEST_VERSION_CURRENT, new MockAnalyzer(random))
|
||||
.setMaxBufferedDocs(10).setMergePolicy(mp);
|
||||
IndexWriter writer = new IndexWriter(dir, conf);
|
||||
|
||||
for(int i=0;i<35;i++) {
|
||||
|
@ -471,8 +474,12 @@ public class TestBackwardsCompatibility extends LuceneTestCase {
|
|||
|
||||
if (!optimized) {
|
||||
// open fresh writer so we get no prx file in the added segment
|
||||
conf = new IndexWriterConfig(TEST_VERSION_CURRENT, new MockAnalyzer(random)).setMaxBufferedDocs(10);
|
||||
((LogMergePolicy) conf.getMergePolicy()).setUseCompoundFile(doCFS);
|
||||
mp = new LogByteSizeMergePolicy();
|
||||
mp.setUseCompoundFile(doCFS);
|
||||
mp.setNoCFSRatio(1.0);
|
||||
// TODO: remove randomness
|
||||
conf = new IndexWriterConfig(TEST_VERSION_CURRENT, new MockAnalyzer(random))
|
||||
.setMaxBufferedDocs(10).setMergePolicy(mp);
|
||||
writer = new IndexWriter(dir, conf);
|
||||
addNoProxDoc(writer);
|
||||
writer.close();
|
||||
|
|
Loading…
Reference in New Issue