fromgroupdocs.searchimportIndexfromgroupdocs.search.commonimportStreamOutputAdapterfromgroupdocs.search.optionsimportOutputFormat# Create an index in the specified folder and index documentsindex=Index("./MyIndex")index.add("./documents")# Get information on indexed documentsdocuments=index.get_indexed_documents()# Write the text of the first document into a filewithopen("document.html","wb")asstream:adapter=StreamOutputAdapter(OutputFormat.HTML,stream)index.get_document_text(documents[0],adapter)