Guides / Managing results / Optimize search results / Adding synonyms

Alternate Correction Synonyms

When creating synonyms, including one-way synonyms, records with the original term and records with the synonym will be ranked evenly, all other things being equal.

When this isn’t the intended behavior, for example, if you would like records with the original term to be ranked higher than those with the synonym, alternative corrections are the solution. Alternative corrections are just like one-way synonyms, except they will generate matches with typos.

There are two types of alternative corrections based on the type parameter:

  • altCorrection1 will return matches with 1 typo
  • altCorrection2 will return matches with 2 typos.

Alternative corrections don’t support correcting typos in multiple words.

The following synonym defines an alternative correction with one typo:

1
2
3
4
5
6
7
8
{
   "objectID": "a-unique-identifier",
   "type": "altCorrection1",
   "word": "tablet",
   "corrections":[
      "ipad"
   ]
}

This ranks records with “tablet” before “ipad”, since records with “ipad” are considered as having one typo.

Changing the type to altCorrection2 defines an alternative correction with two typos.

1
2
3
4
5
6
7
8
9

{
   "objectID": "a-unique-identifier",
   "type": "altCorrection2",
   "word": "tablet",
   "corrections":[
      "ipad"
   ]
}
Did you find this page helpful?