public AssertingAtomicReader(AtomicReader @in) : base(@in) { // check some basic reader sanity Debug.Assert(@in.MaxDoc() >= 0); Debug.Assert(@in.NumDocs() <= @in.MaxDoc()); Debug.Assert(@in.NumDeletedDocs() + @in.NumDocs() == @in.MaxDoc()); Debug.Assert([email protected]() || @in.NumDeletedDocs() > 0 && @in.NumDocs() < @in.MaxDoc()); }
/// <summary> /// Creates a <seealso cref="DocMap"/> instance appropriate for /// this reader. /// </summary> public static DocMap Build(AtomicReader reader) { int maxDoc = reader.MaxDoc(); if (!reader.HasDeletions()) { return new NoDelDocMap(maxDoc); } Bits liveDocs = reader.LiveDocs; return Build(maxDoc, liveDocs); }