Class SynonymTokenFilter
java.lang.Object
com.azure.search.documents.indexes.models.TokenFilter
com.azure.search.documents.indexes.models.SynonymTokenFilter
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) Constructor ofTokenFilter
. -
Method Summary
Modifier and TypeMethodDescriptionGet 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 synonyms property: A list of synonyms in following one of two formats: 1.Get the ignoreCase property: A value indicating whether to case-fold input for matching.setCaseIgnored
(Boolean caseIgnored) Set the ignoreCase 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.Methods inherited from class com.azure.search.documents.indexes.models.TokenFilter
getName
-
Constructor Details
-
SynonymTokenFilter
Constructor ofTokenFilter
.- 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.synonyms
- A list of synonyms in following one of two formats:- incredible, unbelievable, fabulous =%3E amazing - all terms on the left side of =%3E symbol will be replaced with all terms on its right side;
- incredible, unbelievable, fabulous, amazing - comma separated list of equivalent words. Set the expand option to change how this list is interpreted.
-
-
Method Details
-
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 ignoreCase property: A value indicating whether to case-fold input for matching. Default is false.- Returns:
- the ignoreCase value.
-
setCaseIgnored
Set the ignoreCase property: A value indicating whether to case-fold input for matching. Default is false.- Parameters:
caseIgnored
- the ignoreCase 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.
-