SynonymTokenFilter Class
- java.
lang. Object - com.
azure. search. documents. indexes. models. TokenFilter - com.
azure. search. documents. indexes. models. SynonymTokenFilter
- com.
- com.
public final class SynonymTokenFilter
extends TokenFilter
Matches single or multi-word synonyms in a token stream. This token filter is implemented using Apache Lucene.
Constructor Summary
| Constructor | Description |
|---|---|
| SynonymTokenFilter(String name, String[] synonyms) |
Creates an instance of Synonym |
| SynonymTokenFilter(String name, List<String> synonyms) |
Creates an instance of Synonym |
Method Summary
| Modifier and Type | Method and Description |
|---|---|
|
static
Synonym |
fromJson(JsonReader jsonReader)
Reads an instance of Synonym |
| String |
getOdataType()
Get the odata |
| List<String> |
getSynonyms()
Get the synonyms property: A list of synonyms in following one of two formats: 1. |
| Boolean |
isExpand()
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. |
| Boolean |
isIgnoreCase()
Get the ignore |
|
Synonym |
setExpand(Boolean expand)
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. |
|
Synonym |
setIgnoreCase(Boolean ignoreCase)
Set the ignore |
|
Json |
toJson(JsonWriter jsonWriter) |
Methods inherited from TokenFilter
Methods inherited from java.lang.Object
Constructor Details
SynonymTokenFilter
public SynonymTokenFilter(String name, String[] synonyms)
Creates an instance of SynonymTokenFilter class.
Parameters:
SynonymTokenFilter
public SynonymTokenFilter(String name, List<String> synonyms)
Creates an instance of SynonymTokenFilter class.
Parameters:
Method Details
fromJson
public static SynonymTokenFilter fromJson(JsonReader jsonReader)
Reads an instance of SynonymTokenFilter from the JsonReader.
Parameters:
Returns:
Throws:
getOdataType
public String getOdataType()
Get the odataType property: The discriminator for derived types.
Overrides:
SynonymTokenFilter.getOdataType()Returns:
getSynonyms
public List<String> 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:
isExpand
public Boolean isExpand()
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:
isIgnoreCase
public Boolean isIgnoreCase()
Get the ignoreCase property: A value indicating whether to case-fold input for matching. Default is false.
Returns:
setExpand
public SynonymTokenFilter setExpand(Boolean expand)
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:
Returns:
setIgnoreCase
public SynonymTokenFilter setIgnoreCase(Boolean ignoreCase)
Set the ignoreCase property: A value indicating whether to case-fold input for matching. Default is false.
Parameters:
Returns:
toJson
public JsonWriter toJson(JsonWriter jsonWriter)
Overrides:
SynonymTokenFilter.toJson(JsonWriter jsonWriter)Parameters:
Throws: