DelegatingAnalyzerWrapper
An analyzer wrapper, that doesn't allow to wrap components or readers. By disallowing it, it means that the thread local resources can be delegated to the delegate analyzer, and not also be allocated on this analyzer. This wrapper class is the base class of all analyzers that just delegate to another analyzer, e.g. per field name.
This solves the problem of per field analyzer wrapper, where it also maintains a thread local per field token stream components, while it can safely delegate those and not also hold these data structures, which can become expensive memory wise.
Please note: This analyzer uses a private Analyzer.ReuseStrategy, which is returned by . This strategy is used when delegating. If you wrap this analyzer again and reuse this strategy, no delegation is done and the given fallback is used.
Since
4.10.0
Types
A org.gnit.lucenekmp.analysis.Analyzer.ReuseStrategy that delegates to the wrapped analyzer's strategy for reusability of components.
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.