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, 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 |
| Boolean |
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. |
| String |
getOdataType()
Get the odata |
| List<String> |
getSynonyms()
Get the synonyms property: A list of synonyms in following one of two formats: 1. |
| Boolean |
isCaseIgnored()
Get the case |
|
Synonym |
setCaseIgnored(Boolean caseIgnored)
Set the case |
|
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. |
|
Json |
toJson(JsonWriter jsonWriter) |
Methods inherited from TokenFilter
Methods inherited from java.lang.Object
Constructor Details
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:
getExpand
public Boolean 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:
getOdataType
public String getOdataType()
Get the odataType property: A URI fragment specifying the type of token filter.
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:
isCaseIgnored
public Boolean isCaseIgnored()
Get the caseIgnored property: A value indicating whether to case-fold input for matching. Default is false.
Returns:
setCaseIgnored
public SynonymTokenFilter setCaseIgnored(Boolean caseIgnored)
Set the caseIgnored property: A value indicating whether to case-fold input for matching. Default is false.
Parameters:
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:
toJson
public JsonWriter toJson(JsonWriter jsonWriter)
Overrides:
SynonymTokenFilter.toJson(JsonWriter jsonWriter)Parameters:
Throws: