ABC of Database Server Tuning

Home Simply ABC of Database Server Tuning Downloads

MySQL Know How

MYSQL_Presentation.pdf




Imlementing a FUZZY search with MYSQL

A fuzzy search compares how close the SEARCH string and the database COLUMN are matching.
Normally you can not do this with MySQL.

The below MySQL module will allow you to do this.
The algorithm is known as Levenshtein and will compare how close two strings are matching each other.
MySQL levenshtein module compiled for 64bit-x86: mysqllevenshtein.so

Add this module to your server and use it like this:
SELECT * FROM table WHERE levenshtein(column,'your_string')<=1;

levenshtein(column,'your_string')=0 is equal to column='your_string'
levenshtein(column,'your_string')<=1 is equal or 1 char difference
levenshtein(column,'your_string')<=2 is up to two char difference ...