Examples of KeepOnlyLastCommitDeletionPolicy


Examples of org.apache.lucene.index.KeepOnlyLastCommitDeletionPolicy

      fs.mkdirs(perm);
  }

  this.dir = new FileSystemDirectory(fs, perm, true, iconf);
  writer = new IndexWriter(dir, null,
          new KeepOnlyLastCommitDeletionPolicy(),
          MaxFieldLength.UNLIMITED);
//  writer.setMergeScheduler(new SerialMergeScheduler());//new ConcurrentMergeScheduler()
  writer.setMergeFactor(256);
  writer.setTermIndexInterval(128);
  writer.setUseCompoundFile(false);
View Full Code Here

Examples of org.apache.lucene.index.KeepOnlyLastCommitDeletionPolicy

  private int numDocs = 0;

  public RamWriter() throws IOException {
    dir = new RAMDirectory();
    writer = new IndexWriter(dir, null,
        new KeepOnlyLastCommitDeletionPolicy(),
        MaxFieldLength.UNLIMITED);
    writer.setUseCompoundFile(false);
//    writer.setMergeScheduler(new SerialMergeScheduler());
    writer.setMergeFactor(10);
    writer.setTermIndexInterval(128);
View Full Code Here

Examples of org.apache.lucene.index.KeepOnlyLastCommitDeletionPolicy

          reader=IndexReader.open(dir);
        }else if(p.partion.equals("default"))
        {
          RAMDirectory rd=new RAMDirectory();
          rd.setCore(this,p);
          IndexWriter writer=new IndexWriter(rd, null,new KeepOnlyLastCommitDeletionPolicy(), MaxFieldLength.UNLIMITED);
          writer.setMergeFactor(10);
          writer.setUseCompoundFile(false);
          writer.close()
          reader=IndexReader.open(rd);
        }else{
View Full Code Here

Examples of org.apache.lucene.index.KeepOnlyLastCommitDeletionPolicy

      File workerspace=new File(path,getWorkDir(path.getAbsolutePath()));
      deleteDirectory(workerspace);
      workerspace.mkdirs();
     
      FSDirectory dir= open(workerspace,lockFactory);
      IndexWriter writer=new IndexWriter(dir, null,new KeepOnlyLastCommitDeletionPolicy(), MaxFieldLength.UNLIMITED);
      writer.setMergeFactor(512);
      writer.setUseCompoundFile(false);
      if(dirlist.size()>0)
      {
        Directory[] dirs=new Directory[dirlist.size()];
View Full Code Here

Examples of org.apache.lucene.index.KeepOnlyLastCommitDeletionPolicy

  private void merger(ArrayList<DirectoryInfo> mlist,DirectoryInfo to) throws CorruptIndexException, IOException
  {
    try{
      long txid=0;
      to.d.setSchema(params.core.getSchema());
      IndexWriter writer=new IndexWriter(to.d, null,new KeepOnlyLastCommitDeletionPolicy(), MaxFieldLength.UNLIMITED);
      writer.setMergeFactor(64);
      writer.setUseCompoundFile(false);
     
      for(DirectoryInfo tomr:mlist)
      {
View Full Code Here

Examples of org.apache.lucene.index.KeepOnlyLastCommitDeletionPolicy

      bufferDirector.put(RAM_KEY, buffer);
    }

    buffer.d.setSchema(params.core.getSchema());
    IndexWriter writer = new IndexWriter(buffer.d, null,
        new KeepOnlyLastCommitDeletionPolicy(),
        MaxFieldLength.UNLIMITED);
    writer.setMergeFactor(10);
    writer.setUseCompoundFile(false);

    ArrayList<Document> doclist = new ArrayList<Document>(flush.size());
View Full Code Here

Examples of org.apache.lucene.index.KeepOnlyLastCommitDeletionPolicy

  private void merger(ArrayList<DirectoryInfo> mlist,DirectoryInfo to) throws CorruptIndexException, IOException
  {
    try{
      long txid=0;
      to.d.setSchema(params.core.getSchema());
      IndexWriter writer=new IndexWriter(to.d, null,new KeepOnlyLastCommitDeletionPolicy(), MaxFieldLength.UNLIMITED);
      writer.setMergeFactor(64);
      writer.setUseCompoundFile(false);
     
      for(DirectoryInfo tomr:mlist)
      {
View Full Code Here

Examples of org.apache.lucene.index.KeepOnlyLastCommitDeletionPolicy

      bufferDirector.put(RAM_KEY, buffer);
    }

    buffer.d.setSchema(params.core.getSchema());
    IndexWriter writer = new IndexWriter(buffer.d, null,
        new KeepOnlyLastCommitDeletionPolicy(),
        MaxFieldLength.UNLIMITED);
    writer.setMergeFactor(10);
    writer.setUseCompoundFile(false);

    ArrayList<Document> doclist = new ArrayList<Document>(flush.size());
View Full Code Here

Examples of org.apache.lucene.index.KeepOnlyLastCommitDeletionPolicy

  }

  public void testReuseAcrossWriters() throws Exception {
    Directory dir = new MockRAMDirectory();

    SnapshotDeletionPolicy dp = new SnapshotDeletionPolicy(new KeepOnlyLastCommitDeletionPolicy());
    IndexWriter writer = new IndexWriter(dir, true,new StandardAnalyzer(), dp);
    // Force frequent commits
    writer.setMaxBufferedDocs(2);
    Document doc = new Document();
    doc.add(new Field("content", "aaa", Field.Store.YES, Field.Index.ANALYZED, Field.TermVector.WITH_POSITIONS_OFFSETS));
View Full Code Here

Examples of org.apache.lucene.index.KeepOnlyLastCommitDeletionPolicy

  private void runTest(Directory dir) throws Exception {
    // Run for ~7 seconds
    final long stopTime = System.currentTimeMillis() + 7000;

    SnapshotDeletionPolicy dp = new SnapshotDeletionPolicy(new KeepOnlyLastCommitDeletionPolicy());
    final IndexWriter writer = new IndexWriter(dir, true, new StandardAnalyzer(), dp);

    // Force frequent commits
    writer.setMaxBufferedDocs(2);
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.