private void CheckSplitting(Directory dir, Term splitTerm, int leftCount, int rightCount) { using (Directory dir1 = NewDirectory()) { using (Directory dir2 = NewDirectory()) { PKIndexSplitter splitter = new PKIndexSplitter(dir, dir1, dir2, splitTerm, NewIndexWriterConfig(TEST_VERSION_CURRENT, new MockAnalyzer(Random)), NewIndexWriterConfig(TEST_VERSION_CURRENT, new MockAnalyzer(Random))); splitter.Split(); using (IndexReader ir1 = DirectoryReader.Open(dir1)) { using (IndexReader ir2 = DirectoryReader.Open(dir2)) { assertEquals(leftCount, ir1.NumDocs); assertEquals(rightCount, ir2.NumDocs); CheckContents(ir1, "1"); CheckContents(ir2, "2"); } } } } }
private void CheckSplitting(Directory dir, Term splitTerm, int leftCount, int rightCount) { using (Directory dir1 = NewDirectory()) { using (Directory dir2 = NewDirectory()) { PKIndexSplitter splitter = new PKIndexSplitter(dir, dir1, dir2, splitTerm, NewIndexWriterConfig(TEST_VERSION_CURRENT, new MockAnalyzer(Random())), NewIndexWriterConfig(TEST_VERSION_CURRENT, new MockAnalyzer(Random()))); splitter.Split(); using (IndexReader ir1 = DirectoryReader.Open(dir1)) { using (IndexReader ir2 = DirectoryReader.Open(dir2)) { assertEquals(leftCount, ir1.NumDocs); assertEquals(rightCount, ir2.NumDocs); CheckContents(ir1, "1"); CheckContents(ir2, "2"); } } } } }