Class LimitTokenFilter

java.lang.Object
com.azure.search.documents.indexes.models.TokenFilter
com.azure.search.documents.indexes.models.LimitTokenFilter
All Implemented Interfaces:
com.azure.json.JsonSerializable<TokenFilter>

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)
      Creates an instance of LimitTokenFilter class.
      Parameters:
      name - the name value to set.
  • Method Details

    • getOdataType

      public String getOdataType()
      Get the odataType property: A URI fragment specifying the type of token filter.
      Overrides:
      getOdataType in class TokenFilter
      Returns:
      the odataType value.
    • 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 allTokensConsumed property: A value indicating whether all tokens from the input must be consumed even if maxTokenCount is reached. Default is false.
      Returns:
      the allTokensConsumed value.
    • setAllTokensConsumed

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

      public com.azure.json.JsonWriter toJson(com.azure.json.JsonWriter jsonWriter) throws IOException
      Specified by:
      toJson in interface com.azure.json.JsonSerializable<TokenFilter>
      Overrides:
      toJson in class TokenFilter
      Throws:
      IOException
    • fromJson

      public static LimitTokenFilter fromJson(com.azure.json.JsonReader jsonReader) throws IOException
      Reads an instance of LimitTokenFilter from the JsonReader.
      Parameters:
      jsonReader - The JsonReader being read.
      Returns:
      An instance of LimitTokenFilter if the JsonReader was pointing to an instance of it, or null if it was pointing to JSON null.
      Throws:
      IllegalStateException - If the deserialized JSON object was missing any required properties.
      IOException - If an error occurs while reading the LimitTokenFilter.