HtmlHighlighter Class
Represents a search result highlighter that highlights search results in an entire document text formatted in HTML.
Inheritance Hierarchy

Namespace: GroupDocs.Search.Highlighters
Assembly: GroupDocs.Search (in GroupDocs.Search.dll) Version: 20.8
Syntax
public class HtmlHighlighter : Highlighter

The HtmlHighlighter type exposes the following members.

Constructors
  NameDescription
Public methodHtmlHighlighter
Initializes a new instance of the HtmlHighlighter class.
Properties
  NameDescription
Public propertyOutputAdapter
Gets the output adapter passed in the constructor.
Methods
  NameDescription
Public methodEquals (Inherited from Object.)
Protected methodFinalize (Inherited from Object.)
Public methodGetHashCode (Inherited from Object.)
Public methodGetType (Inherited from Object.)
Protected methodMemberwiseClone (Inherited from Object.)
Public methodToString (Inherited from Object.)
Remarks
Examples
The example demonstrates a typical usage of the class.
C#
string indexFolder = @"c:\MyIndex\";
string documentsFolder = @"c:\MyDocuments\";

// Creating an index
Index index = new Index(indexFolder);

// Indexing documents from the specified folder
index.Add(documentsFolder);

// Search for the phase 'Theory of Relativity'
SearchResult result = index.Search("\"Theory of Relativity\"");

// Highlighting found words in the text of a document
FoundDocument document = result.GetFoundDocument(0);
OutputAdapter outputAdapter = new FileOutputAdapter("Highlighted.html");
Highlighter highlighter = new HtmlHighlighter(outputAdapter);
index.Highlight(document, highlighter);
See Also