How can I write a MySQL search that can compensate for data with errors?

Is there a way to write a MySQL search that can compensate for user errors in spelling, etc.

As a random example, someone might enter foo@gmial.com instead of foo@gmail.com.

Even help with search queries to help get relevant data from Google will be helpful. I'm not looking for a search engine, say, what I'm looking for is some kind of legal tool for the administrative control panel.

+4
source share
2 answers

The topic you delve into is called "Fuzzy Search." This is a big rabbit hole to jump down, depending on how accurately you would like to get. There are various methods, such as:

  • Soundex
  • Distance Damerau-Levenshtein
  • Yaro-Winkler distance
  • metaphone
  • double metaphone

Some links to check:

+4
source

There are many ways to do the same. I personally like SOUNDS LIKE .

Check out the SOUNDEX Example .

+3
source

All Articles