Examples of DirectoryManager


Examples of proj.zoie.api.DirectoryManager

    int numReplicas = Integer.parseInt(args[2]);
    System.out.println("source index: "+srcIndex.getAbsolutePath());
    System.out.println("target index: "+targetIndex.getAbsolutePath());
    System.out.println("num replications: "+numReplicas);
    IndexReader reader = null;
    DirectoryManager srcDirMgr = new DefaultDirectoryManager(srcIndex, new DefaultZoieVersionFactory());
    try
    {
      Directory dir = srcDirMgr.getDirectory();
      reader=IndexReader.open(dir,true);
      System.out.println("source index, numdocs: "+reader.numDocs());
    }
    catch(IOException e)
    {
      e.printStackTrace();
    }
    finally
    {
      if (reader!=null)
      {
        reader.close();
      }
      reader = null;
    }
    DirectoryManager targetDirMgr = new DefaultDirectoryManager(targetIndex, new DefaultZoieVersionFactory());

    Directory targetDir = targetDirMgr.getDirectory(true);
   
    IndexWriter writer = null;
    try
    {
      writer = new IndexWriter(targetDir,new StandardAnalyzer(Version.LUCENE_CURRENT),true,MaxFieldLength.UNLIMITED);
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.