StreamOutputAdapter class

StreamOutputAdapter class

Represents an output adapter that collects output into a io.RawIOBase.

Learn more

The StreamOutputAdapter type exposes the following members:

Constructors

Constructor Description
init Initializes a new instance of the StreamOutputAdapter class.

Properties

Property Description
stream The output stream.
output_format The output format. (inherited from ResultBuilderFactory)

Example

from groupdocs.search import Index
from groupdocs.search.common import StreamOutputAdapter
from groupdocs.search.options import OutputFormat

# Create an index in the specified folder and index documents
index = Index("./MyIndex")
index.add("./documents")

# Get information on indexed documents
documents = index.get_indexed_documents()

# Write the text of the first document into a file
with open("document.html", "wb") as stream:
    adapter = StreamOutputAdapter(OutputFormat.HTML, stream)
    index.get_document_text(documents[0], adapter)

See Also