I've been playing around with search.cgi today and got a working solution. Probably not the most efficient solution or neatest but it seems to work fine.
So far each of the search words are matched against the values in user defined relevency fields such as title, description etc...
If there's a match in any field it'll add a value of one to a variable. If there's a match in the title field it'll add a higher value (for instance 2).
The links will then be sorted by this array. A revelvency %percentage is returned next to each link (worked out by dividing the relevency score for the site by the max relevency a site could acheive from using those keywords)
What it doesn't do is say if a word is repeated more than once in description, it'll only match/count that word once. Which I thought would be a good thing to stop people repeating a word and effectively spamming the search engine.
Good Luck!
Glenn http://cgi-resource.co.uk