I have a database where i am storing more than 1000000 names in mysql. Now the task of my application is a bit typical. I not only searches for names in the database,but also finds similar names. Suppose the name is entered as christian, then the application will show suggested names like christine, chris etc. What is the optimal way to do this, without using the like clause. The suggestions will be only on the changes in the last part of the name.
I have a database where i am storing more than 1000000 names in mysql.
Share
If you want also similar names (by sound) something like
SOUNDEX()could help: http://dev.mysql.com/doc/refman/5.0/en/string-functions.html#function_soundexOtherwise
… LIKE 'chri%'seems for me not a bad idea?If you really want just the first characters without
LIKEyou can useSUBSTRING().