Interface IndexReaderProvider
- All Known Implementing Classes:
NearRealTimeIndexReaderProvider,NotSharedIndexReaderProvider
public interface IndexReaderProvider
-
Method Summary
Modifier and TypeMethodDescriptionvoidclear()Closes and drops any cached resources (index readers in particular).default org.apache.lucene.index.DirectoryReaderorg.apache.lucene.index.DirectoryReader
-
Method Details
-
clear
Closes and drops any cached resources (index readers in particular).Should be used when stopping the index, to clean up upon error, or simply to force the creation of a new reader (refresh) on the next call to
getOrCreate().- Throws:
IOException
-
getOrCreate
- 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
-
getCurrentForTests
- Throws:
IOException
-