简体   繁体   English

如何拼写检查客户输入错误的品牌并且它存在于我的数据库中

[英]How to spell check a brand that the customer input wrong and it exists in my database

I need some idea of how is the best way to spellcheck brands.我需要一些关于拼写检查品牌的最佳方法的想法。 I have a table in MYSQL with the name of my products and a form that leads to php search in brands table.我在 MYSQL 中有一个表格,其中包含我的产品名称和一个表格,该表格导致 php 在品牌表格中搜索。 But the some customer are input the name of products wrong and the search bring nothing in the results example:但是有些客户输入了错误的产品名称,搜索结果示例中没有任何结果:

The product is Heineken The customer put Heikenem, hekeinem, heken产品是 Heineken 客户把 Heikenem, hekeinem, heken

Another case too is Jack Daniel's The customer input jack daniels, jack Danis另一个案例也是 Jack Daniel 的 The customer input jack daniels, jack Danis

Sometimes we think only by one side, but if we really think in the roles of the subject, we can see another ways to reach the goal, in this case the goal is make the user avoid wrong inputs of specifics words in the search, for this case, the best way is use autocomplete because, you really don't want words that not exists in your database and the user really want result for things that you have in your database.有时我们只考虑一个方面,但如果我们真正考虑到主题的角色,我们可以看到另一种达到目标的方法,在这种情况下,目标是让用户避免在搜索中输入错误的具体词,因为在这种情况下,最好的方法是使用autocomplete ,因为你真的不想要数据库中不存在的单词,而用户真的想要你在数据库中拥有的东西的结果。

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

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