Highlighter.Net 2.0.0

TokenSources.GetAnyTokenStream Method 

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

public static TokenStream GetAnyTokenStream(
   IndexReader reader,
   int docId,
   string field,
   Analyzer analyzer
);

Parameters

reader
docId
field
analyzer

Return Value

null if field not stored correctly

See Also

TokenSources Class | Lucene.Net.Highlight Namespace