I have a MySQL-table called “customers1” running engine MyISAM. I’ve created a full text index on the columns name,adress and zip. Now one of the customers in that table is me. I spell my name “Gildebrand”. Now i can’t expect that the users can spell my name correctly, many might write “Glidebrant”, but still want to find my. How could i do that search in SQL?
If i run the following query right now
SELECT * FROM customers1 WHERE MATCH(name,adress,zip) AGAINST('Gildebrand')
It finds me, of course. But if i misspell, “Glidebrand”, it doesn’t find me. What would be the best approach to this?
I have a generic search similar to yours. Here’s basically what I do:
This allows the user to just enter a prefix also.
If the user realizes they can’t spell your name, but they’re sure it starts with
Gil, then they can just type that.You can add additional UNION clauses if you want to support prefixes on other columns too.