tidus97 Posted January 22, 2009 Share Posted January 22, 2009 hey guys. here is my mysql query to search for words: $query = mysql_query("SELECT * FROM poll WHERE match (choice1Txt,choice2Txt) against ('$inWord'); "); this works, but it sucks horribly. the words it finds needs to be exact for example, (...which is good sometimes) and sometimes it just doesnt return anything, despite it existing in the DB. in short, its a bit too strict to the point of not returning relavent results... also, i have no way of returning only the most relevant results. but before this i have to get the correct results first. any ideas..? FYI - here is what i think the query means, just incase i understood wrong: select all the rows from the poll table if the word we're searching for ('$inWord') matches that rows choice1Txt and choice2Txt field. Link to comment https://forums.phpfreaks.com/topic/141933-search-query-problems/ Share on other sites More sharing options...
tidus97 Posted January 24, 2009 Author Share Posted January 24, 2009 hi? Link to comment https://forums.phpfreaks.com/topic/141933-search-query-problems/#findComment-745224 Share on other sites More sharing options...
fenway Posted January 27, 2009 Share Posted January 27, 2009 Have you consulted the refman page on fulltext indexing? Link to comment https://forums.phpfreaks.com/topic/141933-search-query-problems/#findComment-747528 Share on other sites More sharing options...
tidus97 Posted February 5, 2009 Author Share Posted February 5, 2009 i dont understand what you mean Link to comment https://forums.phpfreaks.com/topic/141933-search-query-problems/#findComment-755072 Share on other sites More sharing options...
aschk Posted February 5, 2009 Share Posted February 5, 2009 Of course it'll only match the word you've specified in the query. i.e. you're looking for "dinosaur" it's only going to provide you with results that actually contain "dinosaur" NOT "dino", "dinos", "dinosaurs", etc It's not a google searching algorithm you know... it doesn't provide synonyms for words. n.b. there is a way to return results based on relevancy, so i recommend check the MySQL manual for it. Link to comment https://forums.phpfreaks.com/topic/141933-search-query-problems/#findComment-755117 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.