Analyzer
An Analyzer builds TokenStreams, which analyze text. It thus represents a policy for extracting index terms from text.
In order to define what analysis is done, subclasses must define their [ ] in .createComponents. The components are then reused in each call to .tokenStream.
Simple example:
Analyzer analyzer = new Analyzer() {
Since
3.1
Inheritors
Types
This class encapsulates the outer components of a token stream. It provides access to the source (a Reader and the outer end (sink), an instance of [ ] which also serves as the TokenStream returned by .
Properties
Functions
Just like .getPositionIncrementGap, except for Token offsets instead. By default this returns 1. This method is only called if the field produced at least one token for indexing.
Invoked before indexing a IndexableField instance if terms have already been added to that field. This allows custom analyzers to place an automatic position increment gap between IndexbleField instances using the same field name. The default value position increment gap is
Returns a TokenStream suitable for fieldName, tokenizing the contents of text.
Returns a TokenStream suitable for fieldName, tokenizing the contents of reader.