IndexReader is the interface through which IndexSearcher objects access the content of an index.

IndexReader objects always represent a point-in-time view of an index as it existed at the moment the reader was created. If you want search results to reflect modifications to an index, you must create a new IndexReader after the update process completes.

IndexReaders are composites; most of the work is done by individual DataReader sub-components, which may be accessed via fetch() and obtain(). The most efficient and powerful access to index data happens at the segment level via SegReader’s sub-components.

Return the maximum number of documents available to the reader, which is also the highest possible internal document id. Documents which have been marked as deleted but not yet purged from the index are included in this count.