Class KeepTokenFilter

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

public final class KeepTokenFilter extends TokenFilter
A token filter that only keeps tokens with text contained in a specified list of words. This token filter is implemented using Apache Lucene.
  • Constructor Details

    • KeepTokenFilter

      public KeepTokenFilter(String name, List<String> keepWords)
      Creates an instance of KeepTokenFilter class.
      Parameters:
      name - the name value to set.
      keepWords - the keepWords 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.
    • getKeepWords

      public List<String> getKeepWords()
      Get the keepWords property: The list of words to keep.
      Returns:
      the keepWords value.
    • areLowerCaseKeepWords

      public Boolean areLowerCaseKeepWords()
      Get the lowerCaseKeepWords property: A value indicating whether to lower case all words first. Default is false.
      Returns:
      the lowerCaseKeepWords value.
    • setLowerCaseKeepWords

      public KeepTokenFilter setLowerCaseKeepWords(Boolean lowerCaseKeepWords)
      Set the lowerCaseKeepWords property: A value indicating whether to lower case all words first. Default is false.
      Parameters:
      lowerCaseKeepWords - the lowerCaseKeepWords value to set.
      Returns:
      the KeepTokenFilter 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 KeepTokenFilter fromJson(com.azure.json.JsonReader jsonReader) throws IOException
      Reads an instance of KeepTokenFilter from the JsonReader.
      Parameters:
      jsonReader - The JsonReader being read.
      Returns:
      An instance of KeepTokenFilter 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 KeepTokenFilter.