Concepts / Managing results / Alternate correction synonyms
Sep. 26, 2019

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 is not 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 do not support multi-word corrections, so galaxy note, for example, could be used as an input but not as a correction.

The following synonym defines an alternative correction with one typo:

1
2
3
4
5
6
7
8
9

{
   "objectID": "a-unique-identifier",
   "type": "altCorrection1",
   "word": "tablet",
   "corrections":[
      "ipad"
   ]
}

This will create ranking where records with tablet will appear before those with ipad, since records with ipad will be considered as having 1 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?