random1 Posted February 10, 2009 Share Posted February 10, 2009 Is there a better way to add a search engine to a PHP site? I currently have something similar to: http://www.pixel2life.com/publish/tutorials/707/create_your_own_php_mysql_search_engine/ but I am looking for these features: pagination of results (pages) boldening of search term in results quick response and recommendation of mispellings Any help would be appreciated. Link to comment https://forums.phpfreaks.com/topic/144605-search-functionality/ Share on other sites More sharing options...
gevans Posted February 10, 2009 Share Posted February 10, 2009 For pagination check out the tutorial here at phpfreaks CLICKY This should be fairly simple to implement with the code that you're using, give it a try. For boldening of search terms you can do it with a simple str_replace or for more functionality look into preg_replace <?php //str_replace example //use str_ireplace for a case insensitive replace $from_db = "This could be the string returned from your database"; $search_term = "string";//If the word 'string' was searched for str_replace($search_term,'<strong>'.$search_term.'</strong>',$from_db); echo $search_term; Quick response and recommendation will take further work. It'll require a db table of words and implementation of ajax (usualy) for a list of optional search terms. Link to comment https://forums.phpfreaks.com/topic/144605-search-functionality/#findComment-758834 Share on other sites More sharing options...
random1 Posted February 11, 2009 Author Share Posted February 11, 2009 Thanks gevans . Any tips for implementing something like Google's "" feature (exact match)? Link to comment https://forums.phpfreaks.com/topic/144605-search-functionality/#findComment-759341 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.