The text is read from the index if the index stores the texts of the documents; otherwise the document is extracted again from the file at its path. A document that the index does not contain gives no text, and the ErrorOccurred event reports it.
Examples
The example demonstrates how to get the text of an indexed document from an index.
stringindexFolder=@"c:\MyIndex\";stringdocumentsFolder=@"c:\MyDocuments\";// Creating an index in the specified folderIndexindex=newIndex(indexFolder);// Indexing documents from the specified folderindex.Add(documentsFolder);// Getting list of indexed documentsDocumentInfo[]documents=index.GetIndexedDocuments();// Getting a document textif(documents.Length>0){FileOutputAdapteroutputAdapter=newFileOutputAdapter(OutputFormat.Html,@"C:\Text.html");index.GetDocumentText(documents[0],outputAdapter);}
The text is read from the index if the index stores the texts of the documents; otherwise the document is extracted again from the file at its path. A document that the index does not contain gives no text, and the ErrorOccurred event reports it.