Example usage for org.apache.lucene.index IndexWriter getReader

List of usage examples for org.apache.lucene.index IndexWriter getReader

Introduction

In this page you can find the example usage for org.apache.lucene.index IndexWriter getReader.

Prototype

DirectoryReader getReader() throws IOException 

Source Link

Usage

From source file:util.IndexTools.java

License:Open Source License

public IndexTools(IndexWriter indexWriter) {
    try {/*w ww. j a v a  2s  .  co m*/
        ir = indexWriter.getReader();
        is = new IndexSearcher(ir);
    } catch (IOException e) {
        AppLogger.error.log(Level.SEVERE,
                "Could not access index at location " + indexWriter.getDirectory() + " for reading");
        throw new RuntimeException("Exiting application", e);
    }
}