Examples of listAll()


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

        if (gen > 0) {
          // Now that we've removed a commit point, which
          // should have orphan'd at least one index file.
          // Open & close a writer and assert that it
          // actually removed something:
          int preCount = dir.listAll().length;
          writer = new IndexWriter(dir, new WhitespaceAnalyzer(), false, policy, IndexWriter.MaxFieldLength.LIMITED);
          writer.close();
          int postCount = dir.listAll().length;
          assertTrue(postCount < preCount);
        }
View Full Code Here

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

          // Open & close a writer and assert that it
          // actually removed something:
          int preCount = dir.listAll().length;
          writer = new IndexWriter(dir, new WhitespaceAnalyzer(), false, policy, IndexWriter.MaxFieldLength.LIMITED);
          writer.close();
          int postCount = dir.listAll().length;
          assertTrue(postCount < preCount);
        }
      }

      dir.close();
View Full Code Here

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

    reader.setNorm(21, "content", (float) 1.5);
    reader.close();

    // Now, artificially create an extra .del file & extra
    // .s0 file:
    String[] files = dir.listAll();

    /*
    for(int j=0;j<files.length;j++) {
      System.out.println(j + ": " + files[j]);
    }
View Full Code Here

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

    copyFile(dir, "segments_3", "segments_2");

    // Create a bogus cfs file shadowing a non-cfs segment:
    copyFile(dir, "_2.cfs", "_3.cfs");

    String[] filesPre = dir.listAll();

    // Open & close a writer: it should delete the above 4
    // files and nothing more:
    writer = new IndexWriter(dir, new WhitespaceAnalyzer(), false, IndexWriter.MaxFieldLength.LIMITED);
    writer.close();
View Full Code Here

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

    // Open & close a writer: it should delete the above 4
    // files and nothing more:
    writer = new IndexWriter(dir, new WhitespaceAnalyzer(), false, IndexWriter.MaxFieldLength.LIMITED);
    writer.close();

    String[] files2 = dir.listAll();
    dir.close();

    Arrays.sort(files);
    Arrays.sort(files2);
   
View Full Code Here

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

        writer.close();

        long gen = SegmentInfos.getCurrentSegmentGeneration(dir);
        assertTrue("segment generation should be > 1 but got " + gen, gen > 1);

        String[] files = dir.listAll();
        for(int i=0;i<files.length;i++) {
          if (files[i].endsWith(".cfs")) {
            dir.deleteFile(files[i]);
            break;
          }
View Full Code Here

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

                               "_0_1.del",
                               "_0_1.s" + contentFieldIndex,
                               "segments_3",
                               "segments.gen"};

      String[] actual = dir.listAll();
      Arrays.sort(expected);
      Arrays.sort(actual);
      if (!Arrays.equals(expected, actual)) {
        fail("incorrect filenames in index: expected:\n    " + asString(expected) + "\n  actual:\n    " + asString(actual));
      }
View Full Code Here

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

                    "_0_1.del",
                    "_0_1.s" + contentFieldIndex,
                    "segments_3",
                    "segments.gen"};

        String[] actual = dir.listAll();
        Arrays.sort(expected);
        Arrays.sort(actual);
        if (!Arrays.equals(expected, actual)) {
          fail("incorrect filenames in index: expected:\n    " + asString(expected) + "\n  actual:\n    " + asString(actual));
        }
View Full Code Here

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

    }

    IndexReader r = w.getReader();
    w.close();

    for(String fileName : d.listAll()) {
      try {
        d.deleteFile(fileName);
      } catch (IOException ioe) {
        // ignore: this means codec (correctly) is holding
        // the file open
View Full Code Here

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

        // don't use NRT
        w.commit();
        r = DirectoryReader.open(dir);
      }

      List<String> files = new ArrayList<String>(Arrays.asList(dir.listAll()));

      // RAMDir won't have a write.lock, but fs dirs will:
      files.remove("write.lock");

      assertTrue(files.contains("_0.cfs"));
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.