Method GetAnyTokenStream
GetAnyTokenStream(IndexReader, Int32, String, Document, Analyzer)
A convenience method that tries to first get a TermPositionVector for the specified docId, then, falls back to
using the passed in
Declaration
public static TokenStream GetAnyTokenStream(IndexReader reader, int docId, string field, Document doc, Analyzer analyzer)
Parameters
Type | Name | Description |
---|---|---|
IndexReader | reader | The |
System.Int32 | docId | The docId to retrieve. |
System.String | field | The field to retrieve on the document |
Document | doc | The document to fall back on |
Analyzer | analyzer | The analyzer to use for creating the TokenStream if the vector doesn't exist |
Returns
Type | Description |
---|---|
TokenStream | The |
GetAnyTokenStream(IndexReader, Int32, String, Analyzer)
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
Declaration
public static TokenStream GetAnyTokenStream(IndexReader reader, int docId, string field, Analyzer analyzer)
Parameters
Type | Name | Description |
---|---|---|
IndexReader | reader | |
System.Int32 | docId | |
System.String | field | |
Analyzer | analyzer |
Returns
Type | Description |
---|---|
TokenStream | null if field not stored correctly |