Package org.apache.lucene.index

Examples of org.apache.lucene.index.IndexCommit


  private synchronized void processCommits(List<? extends IndexCommit> commits) {
    int size = commits.size();
    if (size == 0) return;

    IndexCommit indexCommit = null;
    for (Object commit : commits) {
      indexCommit = (IndexCommit) commit;
      if (--size > 0 && !_currentSnapshots.containsKey(indexCommit.getSegmentsFileName())) {
        indexCommit.delete();
      }
    }
    _lastCommit = indexCommit;
  }
View Full Code Here


  @Override
  public int doLogic() throws IOException {
    PerfRunData runData = getRunData();
    Config config = runData.getConfig();
    final IndexCommit ic;
    if (commitUserData != null) {
      ic = OpenReaderTask.findIndexCommit(runData.getDirectory(), commitUserData);
    } else {
      ic = null;
    }
View Full Code Here

      writer.addDocument(doc);
      if (i % 2 == 0) {
        writer.commit();
      }
    }
    IndexCommit cp = (IndexCommit) dp.snapshot();
    copyFiles(dir, cp);
    writer.close();
    copyFiles(dir, cp);
   
    writer = new IndexWriter(dir, new StandardAnalyzer(org.apache.lucene.util.Version.LUCENE_CURRENT), dp, IndexWriter.MaxFieldLength.UNLIMITED);
View Full Code Here

TOP

Related Classes of org.apache.lucene.index.IndexCommit

Copyright © 2018 www.massapicom. 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.