Ideas for creating a “Did you mean XYZ” feature into website

后端 未结 4 902
时光说笑
时光说笑 2020-12-13 05:25

I\'d like to give users the ability to search through a large list of businesses, but still find near matches.

Does anyone have any recommendations on how best to go

4条回答
  •  谎友^
    谎友^ (楼主)
    2020-12-13 06:04

    You might check out the SQL Server SOUNDEX and DIFFERENCE functions. SOUNDEX converts a sequence of characters (such as a word) into a 4-character code which will be the same for similar-sounding words. DIFFERENCE gives a number which represents how "different" two strings are based on sound.

    You could, for example, create a computed column based on the SOUNDEX function and match on that column later. Or you could use DIFFERENCE in a WHERE clause.

提交回复
热议问题