Class SynonymTokenFilter
java.lang.Object
com.azure.search.documents.indexes.models.TokenFilter
com.azure.search.documents.indexes.models.SynonymTokenFilter
- All Implemented Interfaces:
com.azure.json.JsonSerializable<TokenFilter>
Matches single or multi-word synonyms in a token stream. This token filter is implemented using Apache Lucene.
-
Constructor Summary
ConstructorsConstructorDescriptionSynonymTokenFilter(String name, List<String> synonyms) Creates an instance of SynonymTokenFilter class. -
Method Summary
Modifier and TypeMethodDescriptionstatic SynonymTokenFilterfromJson(com.azure.json.JsonReader jsonReader) Reads an instance of SynonymTokenFilter from the JsonReader.Get the expand property: A value indicating whether all words in the list of synonyms (if => notation is not used) will map to one another.Get the odataType property: A URI fragment specifying the type of token filter.Get the synonyms property: A list of synonyms in following one of two formats: 1. incredible, unbelievable, fabulous => amazing - all terms on the left side of => symbol will be replaced with all terms on its right side; 2. incredible, unbelievable, fabulous, amazing - comma separated list of equivalent words.Get the caseIgnored property: A value indicating whether to case-fold input for matching.setCaseIgnored(Boolean caseIgnored) Set the caseIgnored property: A value indicating whether to case-fold input for matching.Set the expand property: A value indicating whether all words in the list of synonyms (if => notation is not used) will map to one another.com.azure.json.JsonWritertoJson(com.azure.json.JsonWriter jsonWriter) Methods inherited from class com.azure.search.documents.indexes.models.TokenFilter
getNameMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.azure.json.JsonSerializable
toJson, toJson, toJsonBytes, toJsonString
-
Constructor Details
-
SynonymTokenFilter
Creates an instance of SynonymTokenFilter class.- Parameters:
name- the name value to set.synonyms- the synonyms value to set.
-
-
Method Details
-
getOdataType
Get the odataType property: A URI fragment specifying the type of token filter.- Overrides:
getOdataTypein classTokenFilter- Returns:
- the odataType value.
-
getSynonyms
Get the synonyms property: A list of synonyms in following one of two formats: 1. incredible, unbelievable, fabulous => amazing - all terms on the left side of => symbol will be replaced with all terms on its right side; 2. incredible, unbelievable, fabulous, amazing - comma separated list of equivalent words. Set the expand option to change how this list is interpreted.- Returns:
- the synonyms value.
-
isCaseIgnored
Get the caseIgnored property: A value indicating whether to case-fold input for matching. Default is false.- Returns:
- the caseIgnored value.
-
setCaseIgnored
Set the caseIgnored property: A value indicating whether to case-fold input for matching. Default is false.- Parameters:
caseIgnored- the caseIgnored value to set.- Returns:
- the SynonymTokenFilter object itself.
-
getExpand
Get the expand property: A value indicating whether all words in the list of synonyms (if => notation is not used) will map to one another. If true, all words in the list of synonyms (if => notation is not used) will map to one another. The following list: incredible, unbelievable, fabulous, amazing is equivalent to: incredible, unbelievable, fabulous, amazing => incredible, unbelievable, fabulous, amazing. If false, the following list: incredible, unbelievable, fabulous, amazing will be equivalent to: incredible, unbelievable, fabulous, amazing => incredible. Default is true.- Returns:
- the expand value.
-
setExpand
Set the expand property: A value indicating whether all words in the list of synonyms (if => notation is not used) will map to one another. If true, all words in the list of synonyms (if => notation is not used) will map to one another. The following list: incredible, unbelievable, fabulous, amazing is equivalent to: incredible, unbelievable, fabulous, amazing => incredible, unbelievable, fabulous, amazing. If false, the following list: incredible, unbelievable, fabulous, amazing will be equivalent to: incredible, unbelievable, fabulous, amazing => incredible. Default is true.- Parameters:
expand- the expand value to set.- Returns:
- the SynonymTokenFilter object itself.
-
toJson
- Specified by:
toJsonin interfacecom.azure.json.JsonSerializable<TokenFilter>- Overrides:
toJsonin classTokenFilter- Throws:
IOException
-
fromJson
Reads an instance of SynonymTokenFilter from the JsonReader.- Parameters:
jsonReader- The JsonReader being read.- Returns:
- An instance of SynonymTokenFilter 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 SynonymTokenFilter.
-