MySQL Forums
Forum List  »  Full-Text Search

Normalizing the match score
Posted by: Magic Mok
Date: June 07, 2009 03:09PM

Hi,

Is there any way to normalize the match score inside the sql syntax?
I have found a way through procedures but it doesn't help me, since I need it inside an inner query, and procedures can't be a part of a select (or can they?).

Here is the proc btw:

> DELIMITER |
> DROP PROCEDURE IF EXISTS sp1 |
> CREATE procedure sp1 (search VARCHAR(50))
BEGIN
SET @norm_score=null;
SELECT @norm_score, match(text_column) against (search) AS match_score , match(text_column) against (search)/@norm_score:=ifnull(@norm_score, match(text_column) against (search)) AS normilized_match_score FROM table_name WHERE match(text_column) against (search) ORDER BY match_score DESC;
END |
> DELIMITER ;
> call sp1('aquarium');

Options: ReplyQuote


Subject
Views
Written By
Posted
Normalizing the match score
5951
June 07, 2009 03:09PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.