Highlighter.Net 2.0.0

Highlighter.GetBestFragments Method (Analyzer, String, String, Int32)

Highlights chosen terms in a text, extracting the most relevant sections. This is a convenience method that calls {@link #getBestFragments(TokenStream, String, int)}

public string[] GetBestFragments(
   Analyzer analyzer,
   string fieldName,
   string text,
   int maxNumFragments
);

Parameters

analyzer
the analyzer that will be used to split
text
into chunks
fieldName
the name of the field being highlighted (used by analyzer)
text
text to highlight terms in
maxNumFragments
the maximum number of fragments.

Return Value

highlighted text fragments (between 0 and maxNumFragments number of fragments)

See Also

Highlighter Class | Lucene.Net.Highlight Namespace | Highlighter.GetBestFragments Overload List