AnalyzerWrapper
Extension to Analyzer suitable for Analyzers which wrap other Analyzers.
getWrappedAnalyzer allows the Analyzer to wrap multiple Analyzers which are selected on a per field basis.
wrapComponents allows the TokenStreamComponents of the wrapped Analyzer to then be wrapped (such as adding a new TokenFilter to form new TokenStreamComponents.
wrapReader allows the Reader of the wrapped Analyzer to then be wrapped (such as adding a new CharFilter.
Important: If you do not want to wrap the TokenStream using wrapComponents or the Reader using wrapReader and just delegate to other analyzers (like by field name), use DelegatingAnalyzerWrapper as superclass.
Since
4.0.0
Inheritors
Types
A org.gnit.lucenekmp.analysis.Analyzer.ReuseStrategy that checks the wrapped analyzer's strategy for reusability. If the wrapped analyzer's strategy returns null, components need to be re-created.
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.