Re: scoring/sorting db search results based on score
| From: | Peter Clarke | Date: | Thu, 17 Jul 2003 13:54:24 +0000 |
| Subject: | Re: scoring/sorting db search results based on score | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-155614@lists.php.net to get a copy of this message | ||
Dave wrote:
looking for code snippets or links to examples of the following; - Have a database with multiple fields that will be searched against (happens to be PostgreSQL in this instance, but we can migrate any MySQL based examples/code) - We wish to score search results - ie: a match in "keywords" is worth 5 points, "title" worth 3, and "description" worth 1, perhaps even so far as multiple matches producing multiples of the point value(though that can be a later consideration) - Once we get the results, we would want to display in the order of the scoring, most points first etc... Obviously there are convoluted ways to accomplish, but I am looking to maximize the database performance, limit the number of recursive searches, and use the database/PHP each handle their portion of the search/score/ranking based on their strengths and use of system resources. appreciate any feedback DaveThere is a module for Postgres that does indexed full text searching, with ranking: http://www.sai.msu.su/~megera/oddmuse/index.cgi/Tsearch_V2_Readme