DocumentHighlighter class
Leave feedback
On this page
Represents a search result highlighter that highlights search results in an entire document text.
Learn more
The DocumentHighlighter type exposes the following members:
| Constructor | Description |
|---|---|
| init | Initializes a new DocumentHighlighter. |
| Property | Description |
|---|---|
| output_adapter | The output adapter passed in the constructor. |
| output_format | The output format. (inherited from ResultBuilderFactory) |
from groupdocs.search import Index
from groupdocs.search.common import FileOutputAdapter
from groupdocs.search.highlighters import DocumentHighlighter
from groupdocs.search.options import OutputFormat
index = Index("./index")
index.add("./documents")
result = index.search("Einstein")
if result.document_count > 0:
adapter = FileOutputAdapter(OutputFormat.HTML, "./output/Highlighted.html")
highlighter = DocumentHighlighter(adapter)
index.highlight(result.get_found_document(0), highlighter)
Task guides that use DocumentHighlighter:
Was this page helpful?
Any additional feedback you'd like to share with us?
Please tell us how we can improve this page.
Thank you for your feedback!
We value your opinion. Your feedback will help us improve our documentation.