context

open override val context: CompositeReaderContext

Expert: Returns the root IndexReaderContext for this IndexReader's sub-reader tree.

Iff this reader is composed of sub readers, i.e. this reader being a composite reader, this method returns a CompositeReaderContext holding the reader's direct children as well as a view of the reader tree's atomic leaf contexts. All sub- IndexReaderContext instances referenced from this readers top-level context are private to this reader and are not shared with another context tree. For example, IndexSearcher uses this API to drive searching by one atomic leaf reader at a time. If this reader is not composed of child readers, this method returns an LeafReaderContext.

Note: Any of the sub-CompositeReaderContext instances referenced from this top-level context do not support CompositeReaderContext.leaves. Only the top-level context maintains the convenience leaf-view for performance reasons.