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

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(
	Analyzer analyzer,
	string fieldName,
	string text,
	int maxNumFragments
)
Visual Basic
Public Function GetBestFragments ( _
	analyzer As Analyzer, _
	fieldName As String, _
	text As String, _
	maxNumFragments As Integer _
) As String()
Visual C++
public:
array<String^>^ GetBestFragments(
	Analyzer^ analyzer, 
	String^ fieldName, 
	String^ text, 
	int maxNumFragments
)

Parameters

analyzer
Type: Lucene.Net.Analysis..::..Analyzer
the analyzer that will be used to split
CopyC#
text
into chunks
fieldName
Type: System..::..String
the name of the field being highlighted (used by analyzer)
text
Type: System..::..String
text to highlight terms in
maxNumFragments
Type: System..::..Int32
the maximum number of fragments.

Return Value

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

See Also