Interface IndexReaderProvider

All Known Implementing Classes:
NearRealTimeIndexReaderProvider, NotSharedIndexReaderProvider

public interface IndexReaderProvider
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Closes and drops any cached resources (index readers in particular).
    default org.apache.lucene.index.DirectoryReader
     
    org.apache.lucene.index.DirectoryReader
     
  • Method Details

    • clear

      void clear() throws IOException
      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

      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 call IndexReader.close(), as the index reader may be shared.
      Throws:
      IOException
    • getCurrentForTests

      default org.apache.lucene.index.DirectoryReader getCurrentForTests() throws IOException
      Throws:
      IOException