List of usage examples for org.apache.lucene.index IndexReader equals
@Override public final boolean equals(Object obj)
IndexReader subclasses are not allowed to implement equals/hashCode, so methods are declared final.
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(); } }