org.apache.lucene.analysis.miscellaneous

Class LimitTokenCountAnalyzer

    • Constructor Detail

      • LimitTokenCountAnalyzer

        public LimitTokenCountAnalyzer(Analyzer delegate,
                                       int maxTokenCount,
                                       boolean consumeAllTokens)
        Build an analyzer that limits the maximum number of tokens per field.
        Parameters:
        delegate - the analyzer to wrap
        maxTokenCount - max number of tokens to produce
        consumeAllTokens - whether all tokens from the delegate should be consumed even if maxTokenCount is reached.