/// <summary> /// Expert: this method is called by <see cref="IndexReader"/>s which wrap other readers /// (e.g. <see cref="CompositeReader"/> or <see cref="FilterAtomicReader"/>) to register the parent /// at the child (this reader) on construction of the parent. When this reader is disposed, /// it will mark all registered parents as disposed, too. The references to parent readers /// are weak only, so they can be GCed once they are no longer in use. /// @lucene.experimental /// </summary> public void RegisterParentReader(IndexReader reader) { EnsureOpen(); parentReaders.Add(new IdentityWeakReference <IndexReader>(reader)); }