var indexReader = DirectoryReader.Open(index); var doc = indexReader.Document(docId); indexReader.Dispose();In this example, we first open an index reader from a directory containing an index. Then we use the Get method to retrieve a document by its ID (docId). Finally, we dispose of the index reader to release its resources. The Lucene.Net.Documents namespace provides the Document class, which is used to represent a document in the index. The Get method is part of the Lucene.Net.Index namespace, which handles the indexing and searching of documents. Therefore, the Lucene.Net package library is used.