# Uses of Class
org.apache.lucene.index.DirectoryReader

Packages that use DirectoryReader
Package
Description
org.apache.lucene.index
Code to maintain and access indices.
org.apache.lucene.internal.tests
Internal bridges to package-private internals, for use by the lucene test framework only.
org.apache.lucene.search
Code to search indices.

- ## Uses of DirectoryReader in org.apache.lucene.index

  Subclasses of DirectoryReader in org.apache.lucene.index
  Modifier and Type
  Class
  Description
  `class`
  `ExitableDirectoryReader`
  The `ExitableDirectoryReader` wraps a real index `DirectoryReader` and allows for a `QueryTimeout` implementation object to be checked periodically to see if the thread should exit or not.
  `class`
  `FilterDirectoryReader`
  A FilterDirectoryReader wraps another DirectoryReader, allowing implementations to transform or extend it.
  `final class`
  `SoftDeletesDirectoryReaderWrapper`
  This reader filters out documents that have a doc values value in the given field and treat these documents as soft deleted.
  `final class`
  `StandardDirectoryReader`
  Default implementation of `DirectoryReader`.
  Fields in org.apache.lucene.index declared as DirectoryReader
  Modifier and Type
  Field
  Description
  `protected final DirectoryReader`
  FilterDirectoryReader.`in`
  The filtered DirectoryReader
  Methods in org.apache.lucene.index that return DirectoryReader
  Modifier and Type
  Method
  Description
  `protected abstract DirectoryReader`
  DirectoryReader.`doOpenIfChanged()`
  Implement this method to support `openIfChanged(DirectoryReader)`.
  `protected abstract DirectoryReader`
  DirectoryReader.`doOpenIfChanged(IndexCommit commit)`
  Implement this method to support `openIfChanged(DirectoryReader,IndexCommit)`.
  `protected abstract DirectoryReader`
  DirectoryReader.`doOpenIfChanged(IndexWriter writer, boolean applyAllDeletes)`
  Implement this method to support `openIfChanged(DirectoryReader,IndexWriter,boolean)`.
  `protected final DirectoryReader`
  FilterDirectoryReader.`doOpenIfChanged()`
  `protected final DirectoryReader`
  FilterDirectoryReader.`doOpenIfChanged(IndexCommit commit)`
  `protected final DirectoryReader`
  FilterDirectoryReader.`doOpenIfChanged(IndexWriter writer, boolean applyAllDeletes)`
  `protected DirectoryReader`
  StandardDirectoryReader.`doOpenIfChanged()`
  `protected DirectoryReader`
  StandardDirectoryReader.`doOpenIfChanged(IndexCommit commit)`
  `protected DirectoryReader`
  StandardDirectoryReader.`doOpenIfChanged(IndexWriter writer, boolean applyAllDeletes)`
  `protected DirectoryReader`
  ExitableDirectoryReader.`doWrapDirectoryReader(DirectoryReader in)`
  `protected abstract DirectoryReader`
  FilterDirectoryReader.`doWrapDirectoryReader(DirectoryReader in)`
  Called by the doOpenIfChanged() methods to return a new wrapped DirectoryReader.
  `protected DirectoryReader`
  SoftDeletesDirectoryReaderWrapper.`doWrapDirectoryReader(DirectoryReader in)`
  `DirectoryReader`
  FilterDirectoryReader.`getDelegate()`
  Returns the wrapped `DirectoryReader`.
  `static DirectoryReader`
  DirectoryReader.`open(IndexCommit commit)`
  Expert: returns an IndexReader reading the index in the given `IndexCommit`.
  `static DirectoryReader`
  DirectoryReader.`open(IndexCommit commit, int minSupportedMajorVersion, Comparator<LeafReader> leafSorter)`
  Expert: returns an IndexReader reading the index on the given `IndexCommit`.
  `static DirectoryReader`
  DirectoryReader.`open(IndexWriter writer)`
  Open a near real time IndexReader from the `IndexWriter`.
  `static DirectoryReader`
  DirectoryReader.`open(IndexWriter writer, boolean applyAllDeletes, boolean writeAllDeletes)`
  Expert: open a near real time IndexReader from the `IndexWriter`, controlling whether past deletions should be applied.
  `static DirectoryReader`
  DirectoryReader.`open(Directory directory)`
  Returns a IndexReader reading the index in the given Directory
  `static DirectoryReader`
  DirectoryReader.`open(Directory directory, Comparator<LeafReader> leafSorter)`
  Returns a IndexReader for the index in the given Directory
  `static DirectoryReader`
  StandardDirectoryReader.`open(Directory directory, SegmentInfos infos, List<? extends LeafReader> oldReaders, Comparator<LeafReader> leafSorter)`
  This constructor is only used for `StandardDirectoryReader.doOpenIfChanged(SegmentInfos)`, as well as NRT replication.
  `static DirectoryReader`
  DirectoryReader.`openIfChanged(DirectoryReader oldReader)`
  If the index has changed since the provided reader was opened, open and return a new reader; else, return null.
  `static DirectoryReader`
  DirectoryReader.`openIfChanged(DirectoryReader oldReader, IndexCommit commit)`
  If the IndexCommit differs from what the provided reader is searching, open and return a new reader; else, return null.
  `static DirectoryReader`
  DirectoryReader.`openIfChanged(DirectoryReader oldReader, IndexWriter writer)`
  Expert: If there changes (committed or not) in the `IndexWriter` versus what the provided reader is searching, then open and return a new IndexReader searching both committed and uncommitted changes from the writer; else, return null (though, the current implementation never returns null).
  `static DirectoryReader`
  DirectoryReader.`openIfChanged(DirectoryReader oldReader, IndexWriter writer, boolean applyAllDeletes)`
  Expert: Opens a new reader, if there are any changes, controlling whether past deletions should be applied.
  `protected DirectoryReader`
  ReaderManager.`refreshIfNeeded(DirectoryReader referenceToRefresh)`
  `static DirectoryReader`
  FilterDirectoryReader.`unwrap(DirectoryReader reader)`
  Get the wrapped instance by `reader` as long as this reader is an instance of `FilterDirectoryReader`.
  `static DirectoryReader`
  ExitableDirectoryReader.`wrap(DirectoryReader in, QueryTimeout queryTimeout)`
  Wraps a provided DirectoryReader.
  Methods in org.apache.lucene.index with parameters of type DirectoryReader
  Modifier and Type
  Method
  Description
  `protected void`
  ReaderManager.`decRef(DirectoryReader reference)`
  `protected DirectoryReader`
  ExitableDirectoryReader.`doWrapDirectoryReader(DirectoryReader in)`
  `protected abstract DirectoryReader`
  FilterDirectoryReader.`doWrapDirectoryReader(DirectoryReader in)`
  Called by the doOpenIfChanged() methods to return a new wrapped DirectoryReader.
  `protected DirectoryReader`
  SoftDeletesDirectoryReaderWrapper.`doWrapDirectoryReader(DirectoryReader in)`
  `protected int`
  ReaderManager.`getRefCount(DirectoryReader reference)`
  `static DirectoryReader`
  DirectoryReader.`openIfChanged(DirectoryReader oldReader)`
  If the index has changed since the provided reader was opened, open and return a new reader; else, return null.
  `static DirectoryReader`
  DirectoryReader.`openIfChanged(DirectoryReader oldReader, IndexCommit commit)`
  If the IndexCommit differs from what the provided reader is searching, open and return a new reader; else, return null.
  `static DirectoryReader`
  DirectoryReader.`openIfChanged(DirectoryReader oldReader, IndexWriter writer)`
  Expert: If there changes (committed or not) in the `IndexWriter` versus what the provided reader is searching, then open and return a new IndexReader searching both committed and uncommitted changes from the writer; else, return null (though, the current implementation never returns null).
  `static DirectoryReader`
  DirectoryReader.`openIfChanged(DirectoryReader oldReader, IndexWriter writer, boolean applyAllDeletes)`
  Expert: Opens a new reader, if there are any changes, controlling whether past deletions should be applied.
  `protected DirectoryReader`
  ReaderManager.`refreshIfNeeded(DirectoryReader referenceToRefresh)`
  `protected boolean`
  ReaderManager.`tryIncRef(DirectoryReader reference)`
  `static DirectoryReader`
  FilterDirectoryReader.`unwrap(DirectoryReader reader)`
  Get the wrapped instance by `reader` as long as this reader is an instance of `FilterDirectoryReader`.
  `static DirectoryReader`
  ExitableDirectoryReader.`wrap(DirectoryReader in, QueryTimeout queryTimeout)`
  Wraps a provided DirectoryReader.
  Constructors in org.apache.lucene.index with parameters of type DirectoryReader
  Modifier
  Constructor
  Description
  ``
  `ExitableDirectoryReader(DirectoryReader in, QueryTimeout queryTimeout)`
  Constructor
  ``
  `FilterDirectoryReader(DirectoryReader in, FilterDirectoryReader.SubReaderWrapper wrapper)`
  Create a new FilterDirectoryReader that filters a passed in DirectoryReader, using the supplied SubReaderWrapper to wrap its subreader.
  ``
  `ReaderManager(DirectoryReader reader)`
  Creates and returns a new ReaderManager from the given already-opened `DirectoryReader`, stealing the incoming reference.
  ``
  `SoftDeletesDirectoryReaderWrapper(DirectoryReader in, String field)`
  Creates a new soft deletes wrapper.

- ## Uses of DirectoryReader in org.apache.lucene.internal.tests

  Methods in org.apache.lucene.internal.tests that return DirectoryReader
  Modifier and Type
  Method
  Description
  `DirectoryReader`
  IndexWriterAccess.`getReader(IndexWriter iw, boolean applyDeletions, boolean writeAllDeletes)`

- ## Uses of DirectoryReader in org.apache.lucene.search

  Methods in org.apache.lucene.search with parameters of type DirectoryReader
  Modifier and Type
  Method
  Description
  `default IndexCommit`
  RefreshCommitSupplier.`getSearcherRefreshCommit(DirectoryReader reader)`
  Expert: Returns the index commit that searcher should refresh on.
  Constructors in org.apache.lucene.search with parameters of type DirectoryReader
  Modifier
  Constructor
  Description
  ``
  `SearcherManager(DirectoryReader reader, SearcherFactory searcherFactory)`
  Creates and returns a new SearcherManager from an existing `DirectoryReader`.
  ``
  `SearcherManager(DirectoryReader reader, SearcherFactory searcherFactory, RefreshCommitSupplier refreshCommitSupplier)`
  Creates and returns a new SearcherManager from an existing `DirectoryReader`.