Highlights terms in the text , extracting the most relevant sections and concatenating the chosen fragments with a separator (typically "..."). The document text is analysed in chunks to record hit statistics across the document. After accumulating stats, the fragments with the highest scores are returned in order as "separator" delimited strings.

Namespace: Lucene.Net.Highlight
Assembly: Lucene.Net.Contrib.Highlighter (in Lucene.Net.Contrib.Highlighter.dll) Version: 2.3.2.1

Syntax

C#
public string GetBestFragments(
	TokenStream tokenStream,
	string text,
	int maxNumFragments,
	string separator
)
Visual Basic
Public Function GetBestFragments ( _
	tokenStream As TokenStream, _
	text As String, _
	maxNumFragments As Integer, _
	separator As String _
) As String
Visual C++
public:
String^ GetBestFragments(
	TokenStream^ tokenStream, 
	String^ text, 
	int maxNumFragments, 
	String^ separator
)

Parameters

tokenStream
Type: Lucene.Net.Analysis..::..TokenStream

[Missing <param name="tokenStream"/> documentation for "M:Lucene.Net.Highlight.Highlighter.GetBestFragments(Lucene.Net.Analysis.TokenStream,System.String,System.Int32,System.String)"]

text
Type: System..::..String
text to highlight terms in
maxNumFragments
Type: System..::..Int32
the maximum number of fragments.
separator
Type: System..::..String
the separator used to intersperse the document fragments (typically "...")

Return Value

highlighted text

See Also