atholon Posted May 12, 2008 Share Posted May 12, 2008 Hey, I want to make a search engine that singles out the individual keywords entered into the search and then also uses various synonyms for that word. Can anyone let me know where I can find a listing for that if there is one for free? Quote Link to comment https://forums.phpfreaks.com/topic/105348-search-engine/ Share on other sites More sharing options...
Adam Posted May 13, 2008 Share Posted May 13, 2008 Doubt you'd get one for free that'd be any good.. you'll need to look into creating a crawler / spider.. you'll find millions of results on google.. Adam Quote Link to comment https://forums.phpfreaks.com/topic/105348-search-engine/#findComment-539567 Share on other sites More sharing options...
Fadion Posted May 13, 2008 Share Posted May 13, 2008 Creating that by yourself would need some knowledge, so thats out of reach. Maybe u can use google custom search?? Quote Link to comment https://forums.phpfreaks.com/topic/105348-search-engine/#findComment-539586 Share on other sites More sharing options...
atholon Posted May 13, 2008 Author Share Posted May 13, 2008 It wouldn`t be that complicated if I could find a list of words and their synonyms which I doubt can be found for free. I am just checking to make sure It would make the search engine much more accurate. Quote Link to comment https://forums.phpfreaks.com/topic/105348-search-engine/#findComment-539618 Share on other sites More sharing options...
Fadion Posted May 13, 2008 Share Posted May 13, 2008 U couldnt need a list of words, u would need a complete english thesaurus. Quote Link to comment https://forums.phpfreaks.com/topic/105348-search-engine/#findComment-539641 Share on other sites More sharing options...
blueman378 Posted May 13, 2008 Share Posted May 13, 2008 ive acctually got a code which will use googles feature for that it runs a search through google and then if google says it is spelt wrong this code will get what comes after Did you mean: and return that value Quote Link to comment https://forums.phpfreaks.com/topic/105348-search-engine/#findComment-539645 Share on other sites More sharing options...
atholon Posted May 13, 2008 Author Share Posted May 13, 2008 hehe True Quote Link to comment https://forums.phpfreaks.com/topic/105348-search-engine/#findComment-540251 Share on other sites More sharing options...
blueman378 Posted May 14, 2008 Share Posted May 14, 2008 heres the function if you want it: <?php function DidYouMean($search){ $content = file_get_contents('http://www.google.com/search?q='.str_replace(' ', '+', $search).''); preg_match('#<div id=res>(.*?)<div>#', $content, $matches); $match = str_replace(' Did you mean: ', '', str_replace(' ', '', strip_tags($matches[1]))); if($match == '' || $match == ' '){ return 'none'; }else{ return $match; } } $result = DidYouMean($_GET['q']); if($result == 'none'){ echo 'You spelt that query correct!'; }else{ echo 'We didn\'t find any results for "'.$_GET['q'].'", did you mean <strong>'.$result.'</strong>?'; } ?> Quote Link to comment https://forums.phpfreaks.com/topic/105348-search-engine/#findComment-540654 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.