tokenStream

abstract fun tokenStream(analyzer: Analyzer, reuse: TokenStream?): TokenStream?

Creates the TokenStream used for indexing this field. If appropriate, implementations should use the given Analyzer to create the TokenStreams.

Return

TokenStream value for indexing the document. Should always return a non-null value if the field is to be indexed

Parameters

analyzer

Analyzer that should be used to create the TokenStreams from

reuse

TokenStream for a previous instance of this field name. This allows custom field types (like StringField and NumericField) that do not use the analyzer to still have good performance. Note: the passed-in type may be inappropriate, for example if you mix up different types of Fields for the same field name. So it's the responsibility of the implementation to check.