如何编写可以弥补拼写错误的数据的MySQL搜索? [英] How can I write an MySQL search that can compensate for misspelled data?

查看:91
本文介绍了如何编写可以弥补拼写错误的数据的MySQL搜索?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有什么方法可以编写可以弥补用户在拼写等方面的错误的MySQL搜索?

Is there any way to write an MySQL search that can compensate for user-errors in spelling and the like?

作为随机示例,有人可能会键入foo@gmial.com而不是foo@gmail.com.

As random examples, someone might type foo@gmial.com instead of foo@gmail.com.

即使是搜索字词方面的帮助,也有助于从Google提取相关数据.可以说,我不是在寻找搜索引擎,而是在为管理控制面板提供某种拼写帮助.

Even help with search terms to help pull up relevant data from Google will be helpful. I'm not looking for a search engine, per say, what I'm looking for is some kind of spelling aid for an administrative control panel.

推荐答案

您正在研究的主题称为模糊查找".要跳下来,这是一个大兔子洞,具体取决于您想要获得的精度.有多种方法,例如:

The topic you're delving into is called "Fuzzy Lookup". It's a big rabbit hole to jump down, depending on how precise you'd like to get. There are various methods, such as:

  • soundex
  • Damerau-Levenshtein距离
  • Jaro-Winkler距离
  • 手机
  • 双耳机

一些要签出的参考文献:

Some references to check out:

  • PHP/MySQL small-scale fuzzy search
  • http://en.wikipedia.org/wiki/Approximate_string_matching
  • How do I do a fuzzy match of company names in MYSQL with PHP for auto-complete?
  • Implementation of Levenshtein distance for mysql/fuzzy search?

这篇关于如何编写可以弥补拼写错误的数据的MySQL搜索?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆