Package org.apache.lucene.store

Examples of org.apache.lucene.store.SimpleFSDirectory


    System.out.println(Arrays.toString(args));
    String filename = "/Users/xgu/lucene29test/caches/people-search-index";
    if (args.length>0) filename ="/Users/xgu/lucene29test/caches/people-search-index";
    System.out.println(filename);
    File file = new File(filename);
    FSDirectory directory = new SimpleFSDirectory(file);
//    FSDirectory directory = FSDirectory.getDirectory(file);
    System.out.println(directory.getClass().getName());
    IndexReader reader = IndexReader.open(directory, true);
    loadFile();
//    TermEnum termEnum = reader.terms(new Term("b", ""));
//    while(termEnum.next())
//    {
View Full Code Here


**/
public class SimpleFSDirectoryFactory extends DirectoryFactory {

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

    @Override
    public void setUp() throws Exception {
       super.setUp();
       File file = _TestUtil.getTempDir("testIndex");
       // use a simple FSDir here, to be sure to have SimpleFSInputs
       dir = new SimpleFSDirectory(file,null);
    }
View Full Code Here

    }

    @Test
    public void testUpdateCodec() throws IOException {

        Directory dir = new SimpleFSDirectory(new File(indexdir));
        writeTestIndex(dir);

        Query q1 = new TermQuery(new Term("tag", "exampletag"));
        Query q2 = new TermQuery(new Term("tag", "updatedtag"));
View Full Code Here

    @Override
    public void setUp() throws Exception {
       super.setUp();
       File file = _TestUtil.getTempDir("testIndex");
       // use a simple FSDir here, to be sure to have SimpleFSInputs
       dir = new SimpleFSDirectory(file,null);
    }
View Full Code Here

                    throw new IOException("Unable to create directory: '" + dir + "'");
                }
            }
            LockFactory lockFactory = new NativeFSLockFactory(dir);
            if (simpleFS) {
                directory = new SimpleFSDirectory(dir, lockFactory);
            } else {
                directory = FSDirectory.open(dir, lockFactory);
            }
        }
View Full Code Here

        return false;
      }
    });
    assertEquals(1, files.length);
    File snapDir = files[0];
    Directory dir = new SimpleFSDirectory(snapDir.getAbsoluteFile());
    IndexSearcher searcher = new IndexSearcher(dir, true);
    TopDocs hits = searcher.search(new MatchAllDocsQuery(), 1);

    assertEquals(nDocs, hits.totalHits);
    searcher.close();
    dir.close();
  }
View Full Code Here

      }
    });
    assertEquals(1, files.length);
    File snapDir = files[0];

    IndexSearcher searcher = new IndexSearcher(new SimpleFSDirectory(snapDir.getAbsoluteFile(), null), true);
    TopDocs hits = searcher.search(new MatchAllDocsQuery(), 1);

    assertEquals(500, hits.totalHits);
  }
View Full Code Here

    @Inject public SimpleFsStore(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 SimpleFSDirectory(location, lockFactory);

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

   
    FSDirectory dir = null;
    switch(_mode)
    {
    case SIMPLE:
      dir = new SimpleFSDirectory(_location);
      break;
    case NIO:
      dir = new NIOFSDirectory(_location);
      break;
    case MMAP:
View Full Code Here

TOP

Related Classes of org.apache.lucene.store.SimpleFSDirectory

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.