Jump to content


Photo

Fulltext MATCH with score - only top needed - Help please


  • Please log in to reply
1 reply to this topic

#1 dfrojd

dfrojd
  • Members
  • PipPip
  • Member
  • 11 posts

Posted 19 September 2006 - 11:31 AM

HI, I am using a Fulltext query with rank as described in:

[dev.mysql.com]

with score to list most relevant hits for a php project.

Now using a large database with 7000 entries and a long "against" String I am returned too many results with scores ranging fro ~6.xxx to 0.00xxx.

Could someone please explain how to modify my query so that only results with a relevance (score) greater than 1 are returned.

My Query now is:
---------------------------
$against = "Hotel City Cityreise Cityreisen St├Ądtereise St├Ądtereisen";

$query = "SELECT DISTINCT obj_lfd, obj_bez, obj_krz, obj_img_path_01,";
$query .= "MATCH (";

$query .= "obj_bez, ";
$query .= "obj_krz, ";
$query .= "obj_region_text, ";
$query .= "obj_ort, ";
$query .= "obj_detail, ";
$query .= "obj_freizeit, ";
$query .= "obj_sonst, ";
$query .= "obj_ort_info, ";
$query .= "obj_anreise_info, ";
$query .= "obj_add_desc_01, ";
$query .= "obj_cont_desc_01, ";
$query .= "obj_add_desc_02, ";
$query .= "obj_cont_desc_02, ";
$query .= "obj_add_desc_03, ";
$query .= "obj_cont_desc_03, ";
$query .= "obj_img_desc_01 ";

$query .= ") AGAINST ('";
$query .= $against;
$query .= "') as score ";

$query .= "FROM objekte WHERE MATCH ";
$query .= "( ";

$query .= "obj_bez, ";
$query .= "obj_krz, ";
$query .= "obj_region_text, ";
$query .= "obj_ort, ";
$query .= "obj_detail, ";
$query .= "obj_freizeit, ";
$query .= "obj_sonst, ";
$query .= "obj_ort_info, ";
$query .= "obj_anreise_info, ";
$query .= "obj_add_desc_01, ";
$query .= "obj_cont_desc_01, ";
$query .= "obj_add_desc_02, ";
$query .= "obj_cont_desc_02, ";
$query .= "obj_add_desc_03, ";
$query .= "obj_cont_desc_03, ";
$query .= "obj_img_desc_01 ";

$query .= ") AGAINST ('";
$query .= $against;
$query .= "')";
$query .= " limit $Anfangsposition, $Zeilen_pro_Seite";




#2 shoz

shoz
  • Staff Alumni
  • Advanced Member
  • 600 posts

Posted 19 September 2006 - 01:10 PM

$query .= ") AGAINST ('";
$query .= $against;
$query .= "')";

$query .= " > 1 ";

$query .= " limit $Anfangsposition, $Zeilen_pro_Seite";





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users