Perfidus Posted January 14, 2008 Share Posted January 14, 2008 Is it possible to make a search for a word like "search" and to get back values like: "Tearch" , "Rearch" , "searct" , "starch" just cause they are similar? I know LIKE as a search parameter, but doesn't work like this... Quote Link to comment https://forums.phpfreaks.com/topic/85952-search-engine-finding-similar-words/ Share on other sites More sharing options...
monkeytooth Posted January 14, 2008 Share Posted January 14, 2008 Its possible, not quite sure how, but I have seen it. dropnames.com and godaddy.com are two examples.. dropnames.com or justdropped.com I cant remeber. but they both use it in a sence not so much godaddy as the drop names site. Quote Link to comment https://forums.phpfreaks.com/topic/85952-search-engine-finding-similar-words/#findComment-438827 Share on other sites More sharing options...
tinker Posted January 14, 2008 Share Posted January 14, 2008 A basic way would be: $s = "SELECT * FROM blogs WHERE blog LIKE '%arch%' "; But it wouldn't get the third and would get loads more besides. This version would get the first two... $s = "SELECT * FROM blogs WHERE blog LIKE '_earch%' "; To explain, an '_' matches a single character, a '%' matches multiple characters. If you wanted to get technical there is the 'REGEXP' feature. With this you could break the search word into a number of letter blocks or character groupings and then construct a regular expression statement to handle the search in the manner you desire. FYI there is a whole forum here on the subject of regex and another for mysql. Quote Link to comment https://forums.phpfreaks.com/topic/85952-search-engine-finding-similar-words/#findComment-438839 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.