Package org.apache.lucene.store

Examples of org.apache.lucene.store.NIOFSDirectory$NIOFSIndexInput


    private IndexReader indexReader;
    private ScoreDoc[] hits;

    public void open(File indexDirectory, Analyzer analyzer) throws IOException {
        if (indexDirectory != null) {
            indexReader = DirectoryReader.open(new NIOFSDirectory(indexDirectory));
        } else {
            indexReader = DirectoryReader.open(new NIOFSDirectory(new File("./indexDirectory")));
        }
        indexSearcher = new IndexSearcher(indexReader);
        this.analyzer = analyzer;
    }
View Full Code Here


**/
public class NIOFSDirectoryFactory extends DirectoryFactory {

  @Override
  public Directory open(String path) throws IOException {
    return new NIOFSDirectory(new File(path));
  }
View Full Code Here

    public LuceneIndexer(File sourceDirectory, File indexDirectory, Analyzer analyzerthrows Exception {
        if (indexDirectory != null) {
            if (!indexDirectory.exists()) {
                indexDirectory.mkdir();
            }  
            this.setNiofsDirectory(new NIOFSDirectory(indexDirectory));
        } else {
            this.setNiofsDirectory(new NIOFSDirectory(new File("./indexDirectory")));
        }
       
        this.setAnalyzer(analyzer);
       
        if ((sourceDirectory != null) && (!sourceDirectoryIndexed)) {
View Full Code Here

    String sourceIndex = args[0];
    String targetIndex = args[1];
    String fields = args[2];
   
    // open an IndexReader for the source index (read-only)
    Directory sourceDir = new NIOFSDirectory(new File(sourceIndex));
    IndexReader reader = IndexReader.open(sourceDir, true);
   
    // open an IndexWriter for the target index (with a null Analyzer)
    Directory targetDir = new NIOFSDirectory(new File(targetIndex));
    //IndexWriterConfig config = new IndexWriterConfig(Version.LUCENE_31, null);
    IndexWriter writer = new IndexWriter(targetDir, null, MaxFieldLength.UNLIMITED);
   
    // add indexes from a wrapped IndexReader to the IndexWriter
    try {
View Full Code Here

    @Inject public NioFsStore(ShardId shardId, @IndexSettings Settings indexSettings, IndexStore indexStore, ByteBufferCache byteBufferCache) throws IOException {
        super(shardId, indexSettings, indexStore);
        LockFactory lockFactory = buildLockFactory();
        File location = ((FsIndexStore) indexStore).shardIndexLocation(shardId);
        FileSystemUtils.mkdirs(location);
        this.fsDirectory = new NIOFSDirectory(location, lockFactory);

        boolean suggestUseCompoundFile;
        Tuple<SwitchDirectory, Boolean> switchDirectory = buildSwitchDirectoryIfNeeded(fsDirectory, byteBufferCache);
        if (switchDirectory != null) {
            suggestUseCompoundFile = DEFAULT_SUGGEST_USE_COMPOUND_FILE;
View Full Code Here

    {
    case SIMPLE:
      dir = new SimpleFSDirectory(_location);
      break;
    case NIO:
      dir = new NIOFSDirectory(_location);
      break;
    case MMAP:
      dir = new MMapDirectory(_location);
      break;
    }
View Full Code Here

    {
    case SIMPLE:
      dir = new SimpleFSDirectory(f);
      break;
    case NIO:
      dir = new NIOFSDirectory(f);
      break;
    case MMAP:
      dir = new MMapDirectory(f);
      break;
    }
View Full Code Here

    public LuceneIndexer(File sourceDirectory, File indexDirectory, Analyzer analyzerthrows Exception {
        if (indexDirectory != null) {
            if (!indexDirectory.exists()) {
                indexDirectory.mkdir();
            }  
            this.setNiofsDirectory(new NIOFSDirectory(indexDirectory));
        } else {
            this.setNiofsDirectory(new NIOFSDirectory(new File("./indexDirectory")));
        }
       
        this.setAnalyzer(analyzer);
       
        if ((sourceDirectory != null) && (!sourceDirectoryIndexed)) {
View Full Code Here

    private IndexSearcher indexSearcher;
    private ScoreDoc[] hits;

    public void open(File indexDirectory, Analyzer analyzer) throws IOException {
        if (indexDirectory != null) {
            indexSearcher = new IndexSearcher(new NIOFSDirectory(indexDirectory), true);  
        } else {
            indexSearcher = new IndexSearcher(new NIOFSDirectory(new File("./indexDirectory")), true);
        }
        this.analyzer = analyzer;
    }
View Full Code Here

    public LuceneIndexer(File sourceDirectory, File indexDirectory, Analyzer analyzerthrows Exception {
        if (indexDirectory != null) {
            if (!indexDirectory.exists()) {
                indexDirectory.mkdir();
            }  
            this.setNiofsDirectory(new NIOFSDirectory(indexDirectory));
        } else {
            this.setNiofsDirectory(new NIOFSDirectory(new File("./indexDirectory")));
        }
       
        this.setAnalyzer(analyzer);
       
        if ((sourceDirectory != null) && (!sourceDirectoryIndexed)) {
View Full Code Here

TOP

Related Classes of org.apache.lucene.store.NIOFSDirectory$NIOFSIndexInput

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.