简体   繁体   English

前端SQL搜索-动态检查相似值?

[英]Front-end SQL Search - Dynamically check similar values?

I have a front-end DB search on my website: https://ygoprodeck.com 我的网站上有一个前端数据库搜索: https : //ygoprodeck.com

Currently it checks card names. 目前,它会检查卡名。 A user can type in " magician " and get loads of results. 用户可以输入“ 魔术师 ”并获得大量结果。 But if a user mis-spells it and types " magican " then no results show. 但是,如果用户拼写错误并输入“ magican ”,则不会显示任何结果。

I've been tracking user inputs and it seems a lot of users are mis-spelling card names and getting no results. 我一直在跟踪用户输入,似乎很多用户误输入了卡名,但没有得到结果。

A common example: There are cards with D/D/D in the name but users often type DDD which means they get no results. 一个常见的例子:名称中有带有D / D / D的卡,但是用户经常键入DDD ,这意味着他们没有结果。

Is there a pure SQL method to modify this behaviour or would it need to be implemented through JS/PHP? 是否有一种纯SQL方法来修改此行为,还是需要通过JS / PHP实现?

Thanks! 谢谢!

How about saving all the mis-spells in new table like 如何将所有的拼写错误保存在新表中,例如

CREATE TABLE misSpells(
misSpell VARCAHR, 
correspondingOne VARCHAR
) 
Examples:
    magician, magician
    magican, magician
    DDD, DDD
    D/D/D, DDD

and query this table for the corresponding one? 并在此表中查询对应的表?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM