How to Add and Remove Synonyms | Yext Hitchhikers Platform
What You’ll Learn
In this section, you will learn:
- How to add synonyms to a Search experience
- How to remove snyonyms from a Search experience
How to add synonyms
Synonyms can easily be added to or removed from the Search Configuration UI or JSON editor.
Add Synonyms with the UI
You can set synonyms in the UI by navigating to “Synonyms” within the configuration UI. Simply input your choices into the respective One Way Synonyms, Synonym Sets, or Normalization Synonyms section:
Add Synonyms with the JSON editor
To add a synonym in the JSON editor, simply navigate to the object “Synonyms” in the configuration. Note that One way synonyms, normalization synonyms, and Synonym Sets are defined separately and differently. See below for syntax:
{
"synonyms": {
"oneWay": [
{
"phrase": "careers",
"synonyms": [
"job"
]
}
],
"synonymSet": [
[
"Case study",
"Customer showcase",
"Customer success story"
]
],
"normalization": [
{
"from": [
"nurse",
"physician"
],
"to": "doctor"
}
]
}
}
Fun fact - within one way synonyms you can actually define multiple synonyms for one phrase. A helpful indicator of this functionality is the brackets used in this section - which indicate an array of comma separated values can be supported. For example:
{
"synonyms": {
"oneWay": [
{
"phrase": "careers",
"synonyms": [
"job",
"position"
]
}
],
}
}
In this example, searches for “careers” will also bring up results related to “job” or “postiion.”
Normalization Synonyms are similar as you can also specify multiple terms using comma serperated values to be mapped to a single term.
{
"synonyms": {
"normalization": [
{
"from": [
"nurse",
"physician"
],
"to": "doctor"
}
]
}
}
To remove a synonym you can simply just delete it from the configuration.