LimitTokenCountFilter

constructor(in: TokenStream, maxTokenCount: Int)

Build a filter that only accepts tokens up to a maximum number. This filter will not consume any tokens beyond the maxTokenCount limit

See also


constructor(in: TokenStream, maxTokenCount: Int, consumeAllTokens: Boolean)

Build an filter that limits the maximum number of tokens per field.

Parameters

in

the stream to wrap

maxTokenCount

max number of tokens to produce

consumeAllTokens

whether all tokens from the input must be consumed even if maxTokenCount is reached.