Example usage for org.apache.lucene.index IndexReader equals

List of usage examples for org.apache.lucene.index IndexReader equals

Introduction

In this page you can find the example usage for org.apache.lucene.index IndexReader equals.

Prototype

@Override
public final boolean equals(Object obj) 

Source Link

Document

IndexReader subclasses are not allowed to implement equals/hashCode, so methods are declared final.

Usage

From source file:gov.nasa.ensemble.core.plan.editor.search.PlanSearcher.java

License:Open Source License

/**
 * Refresh the IndexReader so that the IndexSearcher will be aware of any new changes.
 *///www .ja v  a2 s .  c  om
public void refresh() {
    IndexReader tempReader = null;

    try {
        tempReader = searcher.getIndexReader().reopen();

        if (tempReader.equals(reader)) {
            return;
        }

        searcher.close();
        reader.close();
        reader = tempReader;
        searcher = new IndexSearcher(reader);
    } catch (CorruptIndexException e) {
        e.printStackTrace();
    } catch (IOException e) {
        e.printStackTrace();
    }
}