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

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

Syntax

C#
public string GetBestFragment(
	Analyzer analyzer,
	string fieldName,
	string text
)
Visual Basic
Public Function GetBestFragment ( _
	analyzer As Analyzer, _
	fieldName As String, _
	text As String _
) As String
Visual C++
public:
String^ GetBestFragment(
	Analyzer^ analyzer, 
	String^ fieldName, 
	String^ text
)

Parameters

analyzer
Type: Lucene.Net.Analysis..::..Analyzer
the analyzer that will be used to split
CopyC#
text
into chunks
fieldName
Type: System..::..String
Name of field used to influence analyzer's tokenization policy
text
Type: System..::..String
text to highlight terms in

Return Value

highlighted text fragment or null if no terms found

See Also