Full Text Search - display relevance as a percentage

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
muppet
Forum Newbie
Posts: 22
Joined: Sun Jan 25, 2004 2:01 pm

Full Text Search - display relevance as a percentage

Post by muppet »

Can any one help please, i ve checked previous posts on this and mysql.com but cannot seem to find out how to display the relevance as a percentage.

Any advice much appreciated

Thanks :?
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

I was going to suggest this basic approach:
http://www.chuggnutt.com/2004/03/17/updated_search.html

found through: [google]+mysql ~"full text search" ~relevance ~percentage[/google]
muppet
Forum Newbie
Posts: 22
Joined: Sun Jan 25, 2004 2:01 pm

Post by muppet »

I've been trawling through some of these sites and either i'm stupid (most likely) or it just isn't obvious. I've contacted chugnut to see what advice he can offer.

Thanks for your reply, much appreciated :-)
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

the relevence is reported back as a decimal number, when ordered in decending order, the first relevance rating is 100%. Multiply this number by 100, then divide the result by each of the following relevances and you'll receive a new decimal. This is a percentage of the first in their relevance.
Post Reply