random1 Posted July 8, 2011 Share Posted July 8, 2011 I've currently got: SELECT `sid`, `sbody`, `stitle`, `sdescription` FROM `simple_search` WHERE `sbody` LIKE '%test%' ORDER BY `stitle`; How can I change this to order by the number of occurrences of "test"? Quote Link to comment https://forums.phpfreaks.com/topic/241406-ranking-string-search-results/ Share on other sites More sharing options...
fenway Posted July 8, 2011 Share Posted July 8, 2011 You'll need a regex UDF or post-process in PHP. Or do a really-quick-and-dirty string replace, and compare pre- and post- lengths. Quote Link to comment https://forums.phpfreaks.com/topic/241406-ranking-string-search-results/#findComment-1240072 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.