StringOutputAdapter class

StringOutputAdapter class

Represents an output adapter that collects output as a str.

Learn more

The StringOutputAdapter type exposes the following members:

Constructors

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

Methods

Method Description
get_result Gets the resulting string.

Properties

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

Example

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

index = Index("./index")
index.add("./documents")
documents = index.get_indexed_documents()
adapter = StringOutputAdapter(OutputFormat.PLAIN_TEXT)
index.get_document_text(documents[0], adapter)
print(adapter.get_result()[:200])

See Also