aagerdonsa
New Member
I use the full-text search + BOOLEAN MODE, but this not efficient. This is my code:\[code\]$sssql = $server_link->query("SELECT uDR.webTitulo, uDR.webDescripcion, uDR.webkeywords, uDR.weburl, SUM(uDR.priority) as SPriorityFROM ((SELECT s1.webTitulo, s1.webDescripcion, s1.weburl, s1.webkeywords, $a as priority FROM webs s1 WHERE MATCH (webTitulo) AGAINST ('$frase'))UNION(SELECT s2.webTitulo, s2.webDescripcion, s2.weburl, s2.webkeywords, $b as priority FROM webs s2 WHERE MATCH (webkeywords) AGAINST ('$frase*' IN BOOLEAN MODE))UNION(SELECT s3.webTitulo, s3.webDescripcion, s3.weburl, s3.webkeywords, $c as priority FROM webs s3 WHERE MATCH (webDescripcion) AGAINST ('$frase'))UNION(SELECT s4.webTitulo, s4.webDescripcion, s4.weburl, s4.webkeywords, $d as priority FROM webs s4 WHERE MATCH (weburl) AGAINST ('$frase'))) uDRGROUP BY uDR.webTitulo, uDR.weburl, uDR.webDescripcion, uDR.webkeywordsORDER BY SPriority DESC ");\[/code\]$frase = Contains the searched phrase.The code sort the records by:[*]The record with the searched phrase in Title.[*]In keywords.[*]And 4