Class StopwordsTokenFilter

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

public final class StopwordsTokenFilter extends TokenFilter
Removes stop words from a token stream. This token filter is implemented using Apache Lucene.
  • Constructor Details

    • StopwordsTokenFilter

      public StopwordsTokenFilter(String name)
      Creates an instance of StopwordsTokenFilter 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.
    • getStopwords

      public List<String> getStopwords()
      Get the stopwords property: The list of stopwords. This property and the stopwords list property cannot both be set.
      Returns:
      the stopwords value.
    • setStopwords

      public StopwordsTokenFilter setStopwords(List<String> stopwords)
      Set the stopwords property: The list of stopwords. This property and the stopwords list property cannot both be set.
      Parameters:
      stopwords - the stopwords value to set.
      Returns:
      the StopwordsTokenFilter object itself.
    • getStopwordsList

      public StopwordsList getStopwordsList()
      Get the stopwordsList property: A predefined list of stopwords to use. This property and the stopwords property cannot both be set. Default is English.
      Returns:
      the stopwordsList value.
    • setStopwordsList

      public StopwordsTokenFilter setStopwordsList(StopwordsList stopwordsList)
      Set the stopwordsList property: A predefined list of stopwords to use. This property and the stopwords property cannot both be set. Default is English.
      Parameters:
      stopwordsList - the stopwordsList value to set.
      Returns:
      the StopwordsTokenFilter object itself.
    • isCaseIgnored

      public Boolean isCaseIgnored()
      Get the caseIgnored property: A value indicating whether to ignore case. If true, all words are converted to lower case first. Default is false.
      Returns:
      the caseIgnored value.
    • setCaseIgnored

      public StopwordsTokenFilter setCaseIgnored(Boolean caseIgnored)
      Set the caseIgnored property: A value indicating whether to ignore case. If true, all words are converted to lower case first. Default is false.
      Parameters:
      caseIgnored - the caseIgnored value to set.
      Returns:
      the StopwordsTokenFilter object itself.
    • areTrailingStopWordsRemoved

      public Boolean areTrailingStopWordsRemoved()
      Get the trailingStopWordsRemoved property: A value indicating whether to ignore the last search term if it's a stop word. Default is true.
      Returns:
      the trailingStopWordsRemoved value.
    • setTrailingStopWordsRemoved

      public StopwordsTokenFilter setTrailingStopWordsRemoved(Boolean trailingStopWordsRemoved)
      Set the trailingStopWordsRemoved property: A value indicating whether to ignore the last search term if it's a stop word. Default is true.
      Parameters:
      trailingStopWordsRemoved - the trailingStopWordsRemoved value to set.
      Returns:
      the StopwordsTokenFilter 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 StopwordsTokenFilter fromJson(com.azure.json.JsonReader jsonReader) throws IOException
      Reads an instance of StopwordsTokenFilter from the JsonReader.
      Parameters:
      jsonReader - The JsonReader being read.
      Returns:
      An instance of StopwordsTokenFilter 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 StopwordsTokenFilter.
    • setStopwords

      public StopwordsTokenFilter setStopwords(String... stopwords)
      Set the stopwords property: The list of stopwords. This property and the stopwords list property cannot both be set.
      Parameters:
      stopwords - the stopwords value to set.
      Returns:
      the StopwordsTokenFilter object itself.