A convenience method that tries a number of approaches to getting a token stream. The cost of finding there are no termVectors in the index is minimal (1000 invocations still registers 0 ms). So this "lazy" (flexible?) approach to coding is probably acceptable

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

Syntax

C#
public static TokenStream GetAnyTokenStream(
	IndexReader reader,
	int docId,
	string field,
	Analyzer analyzer
)
Visual Basic
Public Shared Function GetAnyTokenStream ( _
	reader As IndexReader, _
	docId As Integer, _
	field As String, _
	analyzer As Analyzer _
) As TokenStream
Visual C++
public:
static TokenStream^ GetAnyTokenStream(
	IndexReader^ reader, 
	int docId, 
	String^ field, 
	Analyzer^ analyzer
)

Parameters

reader
Type: Lucene.Net.Index..::..IndexReader

[Missing <param name="reader"/> documentation for "M:Lucene.Net.Highlight.TokenSources.GetAnyTokenStream(Lucene.Net.Index.IndexReader,System.Int32,System.String,Lucene.Net.Analysis.Analyzer)"]

docId
Type: System..::..Int32

[Missing <param name="docId"/> documentation for "M:Lucene.Net.Highlight.TokenSources.GetAnyTokenStream(Lucene.Net.Index.IndexReader,System.Int32,System.String,Lucene.Net.Analysis.Analyzer)"]

field
Type: System..::..String

[Missing <param name="field"/> documentation for "M:Lucene.Net.Highlight.TokenSources.GetAnyTokenStream(Lucene.Net.Index.IndexReader,System.Int32,System.String,Lucene.Net.Analysis.Analyzer)"]

analyzer
Type: Lucene.Net.Analysis..::..Analyzer

[Missing <param name="analyzer"/> documentation for "M:Lucene.Net.Highlight.TokenSources.GetAnyTokenStream(Lucene.Net.Index.IndexReader,System.Int32,System.String,Lucene.Net.Analysis.Analyzer)"]

Return Value

null if field not stored correctly

See Also