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"? 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. Link to comment https://forums.phpfreaks.com/topic/241406-ranking-string-search-results/#findComment-1240072 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.