well, this is something ive never done, so i dont know anything about it. Its pretty much like a basic text search. What i have is a bunch of items with descriptions, the user enters in a bunch of keywords and results are returned based on those words. What i currently have just returns entries that have ALL the keywords entered, but what i want is for it to return results based on how many of those keywords the description has. So like, the top thing would be the one that has the most matches for those keywords, and it goes in descending order. it doesnt have to have all the keywords. is this something that gets super complicated, or can it be fairly simple?well it can get real complicated depending on how you search.
seems to me that you have to make a seperate query per keyword. not really real world but it can be done. or you can just edit teh query and count() how many times it find it for the search.
it gets tricky when you start getting into OR or AND or NOT or AND NOT. stuff like that.mysql should have a built in function for this! *blows rasberries at mysql*
ps. it wouldnt have any sort of NOTS and stuff, just multiple key words to look for.then you just use
count(keyword) as total_words where keyword like '%$word%' OR keyword like '%$word%' GROUP BY total_words
not sure if something like that would work without making a seperate query or loop per search word.thanks scoutt, ill try it later. im all programmed out for today. ive had to finish a CMS and write all the code for the main page, plus all the javascript to go with my new possible site design *plops on the floor*check out the match thing of mysql
<!-- m --><a class="postlink" href="http://www.mysql.com/doc/en/Fulltext_Search.htmlthanks">http://www.mysql.com/doc/en/Fulltext_Search.htmlthanks</a><!-- m -->! that really helped.
seems to me that you have to make a seperate query per keyword. not really real world but it can be done. or you can just edit teh query and count() how many times it find it for the search.
it gets tricky when you start getting into OR or AND or NOT or AND NOT. stuff like that.mysql should have a built in function for this! *blows rasberries at mysql*
ps. it wouldnt have any sort of NOTS and stuff, just multiple key words to look for.then you just use
count(keyword) as total_words where keyword like '%$word%' OR keyword like '%$word%' GROUP BY total_words
not sure if something like that would work without making a seperate query or loop per search word.thanks scoutt, ill try it later. im all programmed out for today. ive had to finish a CMS and write all the code for the main page, plus all the javascript to go with my new possible site design *plops on the floor*check out the match thing of mysql
<!-- m --><a class="postlink" href="http://www.mysql.com/doc/en/Fulltext_Search.htmlthanks">http://www.mysql.com/doc/en/Fulltext_Search.htmlthanks</a><!-- m -->! that really helped.