[PHP-DB] ranking database searches
This may be more trouble than I'm interested in, but I'm working on search functionality for a number of our MySQL database projects. I'm looking for ways (or just ideas about ways) to set up a ranking system such that I could have exact matches at the top of the list, then multiple partial matches listed below that, and single partial matches below that, etc. I'm proceeding currently with multiple queries and associative arrays, but I'm wondering if I'm going down the wrong path. It seems like it's going to add a ton of processing overhead. Any thoughts? Michael Hall Lead Web Developer / Database Engineer Prairie Fire Internet Technologies [EMAIL PROTECTED] -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP-DB] ranking database searches
2 ideas: 1) Define the loosest item that returns results (likely regex) then search with slightly tighter criteria within the results. Good for situations where even partial matches are a small percentage of the total data 2) Check every record, and give it a score based on proximity to the search criteria, then sort. Good for returning the top N results with the possible results being a large portion of the total. Of course you could combine the two and get a subset, then score it and sort Just ideas __ Your mouse has moved. You must restart Windows for your changes to take effect. #!/usr/bin/perl print $i=pack(c5,(41*2),sqrt(7056),(unpack(c,H)-2),oct(115),10); -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]