koen Posted May 2, 2008 Share Posted May 2, 2008 Example: searching for string ABCDEFG, and in DB there's string ABCDE and ABC. ABCDE is best match. What sql can I use for this? One option I see but don't really like is searching with WHERE string LIKE abcdefg OR string LIKE abcdef OR ... Link to comment https://forums.phpfreaks.com/topic/103935-select-where-best-possible-match/ Share on other sites More sharing options...
hitman6003 Posted May 3, 2008 Share Posted May 3, 2008 Fulltext indexing. http://www.mysql.com/fulltext Link to comment https://forums.phpfreaks.com/topic/103935-select-where-best-possible-match/#findComment-532178 Share on other sites More sharing options...
koen Posted May 3, 2008 Author Share Posted May 3, 2008 I've read the section and tried some things. But I don't see how full text search can match a partial word. To give another example: the field contains 1 word for every row row1: possibl row2: possib I want the best match when I search for 'possible' (wich is the field from row 1). Link to comment https://forums.phpfreaks.com/topic/103935-select-where-best-possible-match/#findComment-532391 Share on other sites More sharing options...
mwasif Posted May 4, 2008 Share Posted May 4, 2008 Try using SOUNDEX(). Link to comment https://forums.phpfreaks.com/topic/103935-select-where-best-possible-match/#findComment-532900 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.