Skip to content

Did You Mean

Ecommerce Search does not use fuzzy search, which means that simple typos in searches are not automatically corrected unless they are manually registered as misspellings. This is intentional, as fuzziness can lead to unexpected behaviour that can degrade the search experience. Instead, a simple typo can be corrected by performing a Did You Mean search.

Tip

Unified Search is the recommended way to access the Did You Mean feature. Did You Mean results are fetched in parallel with searches and are automatically applied if no results are found for the original phrase.

The POST /did-you-mean endpoint provides an easy way to present the user with an alternative search phrase if the phrase contains small typos or misspellings.

Example

1
2
3
4
{
  "segmentId": "b2c-dk-da",
  "phrase": "bicykle"
}

Gives the following response.

1
2
3
{
  "didYouMean": "bicycle"
}

Example

Examples of phrases where did-you-mean will improve search results are:

  • Simple misspellings: Bicyckle -> Bicycle
  • Typos: Sparkling qater -> Sparkling water
  • Missing spaces: Icecream -> Ice cream
  • Superfluous spaces: Star ship -> Starship
  • Missing hyphens: High tech -> High-tech

If the requested phrase does not contain any errors, i.e. a product can be found using the phrase, then an empty result will be returned.

Depending on the intended behaviour of the site, it may be a good idea to immediately run a second search for the corrected phrase.

Improving did you mean results

To prevent did you mean to suggest changes to correctly spelled words, create a misspelling and set the correct spelling to the word that should not be changed. The misspellings are not required to be entered.