Package org.apache.lucene.store

Examples of org.apache.lucene.store.Directory.fileExists()


        //  now open reader again & set norm for doc 0 (writes to _0_2.s0)
        reader = IndexReader.open(dir, false);
        reader.setNorm(0, "content", (float) 2.0);
        reader.close();
        assertFalse("failed to remove first generation norms file on writing second generation",
                    dir.fileExists("_0_1.s0"));
       
        dir.close();
    }

    /* ??? public void testOpenEmptyDirectory() throws IOException{
View Full Code Here


        //  now open reader again & set norm for doc 0 (writes to _0_2.s0)
        reader = IndexReader.open(dir, false);
        reader.setNorm(0, "content", (float) 2.0);
        reader.close();
        assertFalse("failed to remove first generation norms file on writing second generation",
                    dir.fileExists("_0_1.s0"));
       
        dir.close();
    }

View Full Code Here

      out.writeByte((byte) 42);
      out.close();
     
      new IndexWriter(dir, newIndexWriterConfig( TEST_VERSION_CURRENT, new MockAnalyzer(random()))).close();
     
      assertTrue(dir.fileExists("myrandomfile"));
    } finally {
      dir.close();
    }
  }
 
View Full Code Here

      out.writeByte((byte) 42);
      out.close();
     
      new IndexWriter(dir, newIndexWriterConfig( TEST_VERSION_CURRENT, new MockAnalyzer(random()))).close();
     
      assertTrue(dir.fileExists("_a.frq"));
     
      IndexWriter iw = new IndexWriter(dir,
          newIndexWriterConfig(TEST_VERSION_CURRENT, new MockAnalyzer(random())));
      iw.addDocument(new Document());
      iw.close();
View Full Code Here

      IndexWriter iw = new IndexWriter(dir,
          newIndexWriterConfig(TEST_VERSION_CURRENT, new MockAnalyzer(random())));
      iw.addDocument(new Document());
      iw.close();
     
      assertFalse(dir.fileExists("_a.frq"));
    } finally {
      dir.close();
    }
  }
View Full Code Here

          dirToTest = new CompoundFileReader(dir, IndexFileNames.segmentFileName(storesSegment, ext), IndexFileNames.segmentFileName(storesSegment, extpos));
        } else {
          dirToTest = dir;
        }
        try {
          hasVectors = dirToTest.fileExists(IndexFileNames.segmentFileName(storesSegment, IndexFileNames.VECTORS_INDEX_EXTENSION));
        } finally {
          if (isCompoundFile) {
            dirToTest.close();
          }
        }
View Full Code Here

    // create separate norms file
    IndexReader r = IndexReader.open(src, false);
    r.setNorm(0, "c", (byte) 1);
    r.close();
    assertTrue(".del file not found", src.fileExists("_0_1.del"));
    assertTrue("separate norms file not found", src.fileExists("_0_1.s0"));
   
    // Case 1: force 'CFS' on target
    lmp.setUseCompoundFile(true);
    lmp.setNoCFSRatio(1.0);
View Full Code Here

    // create separate norms file
    IndexReader r = IndexReader.open(src, false);
    r.setNorm(0, "c", (byte) 1);
    r.close();
    assertTrue(".del file not found", src.fileExists("_0_1.del"));
    assertTrue("separate norms file not found", src.fileExists("_0_1.s0"));
   
    // Case 1: force 'CFS' on target
    lmp.setUseCompoundFile(true);
    lmp.setNoCFSRatio(1.0);
    w.addIndexes(src);
View Full Code Here

      out.writeByte((byte) 42);
      out.close();

      new IndexWriter(dir, new WhitespaceAnalyzer(), true, IndexWriter.MaxFieldLength.LIMITED).close();

      assertTrue(dir.fileExists("myrandomfile"));

      // Make sure this does not copy myrandomfile:
      Directory dir2 = new RAMDirectory(dir);
      assertTrue(!dir2.fileExists("myrandomfile"));
View Full Code Here

      assertTrue(dir.fileExists("myrandomfile"));

      // Make sure this does not copy myrandomfile:
      Directory dir2 = new RAMDirectory(dir);
      assertTrue(!dir2.fileExists("myrandomfile"));

    } finally {
      dir.close();
      _TestUtil.rmDir(indexDir);
    }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.