cancel
Showing results for 
Search instead for 
Did you mean: 

Live Search - Search Synonyms Matches Should Indicate They Are Synonyms

0 Kudos

Live Search - Search Synonyms Matches Should Indicate They Are Synonyms

For example, if we search for "fiter" it shows us results for "filter" in the response as expected but there's no messaging for "Did you mean?" or "showing results for filter"

 

Currently, there is nothing in the live search response indicating what it's showing results for when the customer mis-types or it is showing results due to a fuzzy match.  Because of this, we can't show that it Didn't find results for "fiter" but it's showing you results for "filter" instead.

1 Comment
mkotovadob
Visitor

if we search for "fiter" it shows us results for "filter" in the response as expected but there's no messaging for "Did you mean?" or "showing results for filter"

 

Fuzzy search (aka typo tolerantce) is built into Live Search and gets applied to all queries by default. Because fuzzy search can match on multiple "correct" words at the same time, it is not always possible to show a single "did you mean" suggestion. 

Consider the following example for an online clothing store: 

Query: "shurt" 

Search results: will match on "shirt" and also "short".

 

Fuzzy search relies on Levenshtein distance, which computes how different any two terms are, giving preference to the closest one. Meaning, a result that is 1 letter different will be shown before a result that is 2 letters different from the original query. 

 

In the above example, both words are 1 letter away, so they will be considered as equally weighted matches. In some cases you might have more than 2 possible but equal matches, depending on the query. 

 

That being said, if the main end goal is to communicate to the shoper what term was actually matched on, you can leverage the highlights feature of the Live Search API. The API returns strings of text in each search result that are matches (and fuzzy matches) from the original query. You can use these objects to highlight to the shoppers what the seach engine is actually finding based on their search terms. 

 

Here's an example from the Live Search GraphQL playground that demonstrates the above "shurt" example resulting in multiple matches: 

 

https://imgur.com/a/m66Ylap

 

Hope that helps!