1. $sql = “select ( IF( ( match(meta_keyword) against(?) ), (40 + (match(meta_keyword) against(?)) + ( IF( (meta_keyword REGEXP ?),10,0) ) ) , 0 ) ) as meta_keyword_weight, ( IF( ( match(content) against(?) ), (20 + (match(content) against(?)) + ( IF( (content REGEXP ?),10,0) ) ) , 0 ) ) as content_weight, ( IF( ( match(meta_description) against(?) ), (10 + (match(meta_description) against(?)) + ( IF( (meta_description REGEXP ?),5,0) ) ) , 0 ) ) as meta_description_weight, ( IF( ( match(body) against(?) ), (10 + (match(body) against(?)) + ( IF( (body REGEXP ?),5,0) ) ) , 0 ) ) as body_weight, ( IF( ( match(title) against(?) ), (30 + (match(title) against(?)) ) , 0 ) ) as title_weight, ( IF( ( match(meta_title) against(?) ), (10 + (match(meta_title) against(?)) ) , 0 ) ) as meta_title_weight from page_i18n”;
和不错的一个关联SQL
SQL权重计算技巧
本文介绍了一种使用SQL进行内容匹配的权重计算方法,通过不同字段的重要性赋予权重值,以此来评估页面的相关性和重要性。
212

被折叠的 条评论
为什么被折叠?



