Interface IndexReaderProvider
-
- All Known Implementing Classes:
NearRealTimeIndexReaderProvider,NotSharedIndexReaderProvider
public interface IndexReaderProvider
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidclear()Closes and drops any cached resources (index readers in particular).org.apache.lucene.index.DirectoryReadergetOrCreate()voidrefresh()Make sure the index reader returned by the next call togetOrCreate()will return an up-to-date view of the index.
-
-
-
Method Detail
-
clear
void clear() throws IOExceptionCloses and drops any cached resources (index readers in particular).Should be used when stopping the index or to clean up upon error.
- Throws:
IOException
-
refresh
void refresh()
Make sure the index reader returned by the next call togetOrCreate()will return an up-to-date view of the index.
-
getOrCreate
org.apache.lucene.index.DirectoryReader getOrCreate() throws IOException- Returns:
- A ready-to-use index reader, with its reference count already increased.
Callers are responsible for calling
IndexReader.decRef()when they are done with the index reader. Callers must not callIndexReader.close(), as the index reader may be shared. - Throws:
IOException
-
-