Пример #1
0
 @Override
 public void setUp() throws Exception {
   super.setUp();
   mergedDir = newDirectory();
   merge1Dir = newDirectory();
   merge2Dir = newDirectory();
   DocHelper.setupDoc(doc1);
   SegmentCommitInfo info1 = DocHelper.writeDoc(random(), merge1Dir, doc1);
   DocHelper.setupDoc(doc2);
   SegmentCommitInfo info2 = DocHelper.writeDoc(random(), merge2Dir, doc2);
   reader1 = new SegmentReader(info1, newIOContext(random()));
   reader2 = new SegmentReader(info2, newIOContext(random()));
 }
 public void testIndexDivisor() throws IOException {
   dir = new MockRAMDirectory();
   testDoc = new Document();
   DocHelper.setupDoc(testDoc);
   DocHelper.writeDoc(dir, testDoc);
   testTermDocs(2);
   testBadSeek(2);
   testSkipTo(2);
 }
 public void testIndexDivisorAfterLoad() throws IOException {
   dir = new MockRAMDirectory();
   testDoc = new Document();
   DocHelper.setupDoc(testDoc);
   SegmentInfo si = DocHelper.writeDoc(dir, testDoc);
   SegmentReader reader = SegmentReader.get(si);
   assertEquals(1, reader.docFreq(new Term("keyField", "Keyword")));
   try {
     reader.setTermInfosIndexDivisor(2);
     fail("did not hit IllegalStateException exception");
   } catch (IllegalStateException ise) {
     // expected
   }
 }
 protected void setUp() throws Exception {
   super.setUp();
   DocHelper.setupDoc(testDoc);
   info = DocHelper.writeDoc(dir, testDoc);
 }