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. Quote 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? Quote 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? Quote 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 Quote 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. Quote Link to comment https://forums.phpfreaks.com/topic/141933-search-query-problems/#findComment-755117 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.