Class LimitTokenFilter

java.lang.Object
com.azure.search.documents.indexes.models.TokenFilter
com.azure.search.documents.indexes.models.LimitTokenFilter

public final class LimitTokenFilter extends TokenFilter
Limits the number of tokens while indexing. This token filter is implemented using Apache Lucene.
  • Constructor Details

    • LimitTokenFilter

      public LimitTokenFilter(String name)
      Constructor of TokenFilter.
      Parameters:
      name - The name of the token filter. It must only contain letters, digits, spaces, dashes or underscores, can only start and end with alphanumeric characters, and is limited to 128 characters.
  • Method Details

    • getMaxTokenCount

      public Integer getMaxTokenCount()
      Get the maxTokenCount property: The maximum number of tokens to produce. Default is 1.
      Returns:
      the maxTokenCount value.
    • setMaxTokenCount

      public LimitTokenFilter setMaxTokenCount(Integer maxTokenCount)
      Set the maxTokenCount property: The maximum number of tokens to produce. Default is 1.
      Parameters:
      maxTokenCount - the maxTokenCount value to set.
      Returns:
      the LimitTokenFilter object itself.
    • areAllTokensConsumed

      public Boolean areAllTokensConsumed()
      Get the consumeAllTokens property: A value indicating whether all tokens from the input must be consumed even if maxTokenCount is reached. Default is false.
      Returns:
      the consumeAllTokens value.
    • setAllTokensConsumed

      public LimitTokenFilter setAllTokensConsumed(Boolean allTokensConsumed)
      Set the consumeAllTokens property: A value indicating whether all tokens from the input must be consumed even if maxTokenCount is reached. Default is false.
      Parameters:
      allTokensConsumed - the consumeAllTokens value to set.
      Returns:
      the LimitTokenFilter object itself.