View Single Post
  #162  
Old 09-30-2005, 09:50 AM
 
Don L Don L is offline
 

Member
  
Join Date: Sep 2005
Posts: 27
 

Default

try experimenting with the weighting given to keywords found in certain areas. It sounds like you want to highly favor keywords found in the title so try bumping up $topscore for the title section.

Maybe something like ($topscore changed from 4 to 10 for by_title):
Code:
# # Generate additional fields string # $add_fields_string = ''; $scorestr=""; // Add score to fields - LNJ if (!empty($data["by_title"]) && count($search_words)>0) { $scorestr.="if($sql_tbl[products].product like '%". $data["substring"] ."%',5,0) + "; //Add high score for exact match - LNJ $topscore=10; // Yeah I know HARDCODED - LNJ $scoredesc=$topscore/count($search_words); //Get decrementing number for scores - LNJ foreach($search_words as $search_word){ $scorestr.="if($sql_tbl[products].product like '%". $search_word ."%',$topscore,0) + "; //add individual word score - LNJ $topscore=$topscore-$scoredesc; //Descrement individual score for word - LNJ } } if (!empty($data["by_shortdescr"]) && count($search_words)>0) { $scorestr.="if($sql_tbl[products].descr like '%". $data["substring"] ."%',3,0) + "; //Add high score for exact match - LNJ $topscore=2; $scoredesc=$topscore/count($search_words); //Get decrementing number for scores - LNJ foreach($search_words as $search_word){ $scorestr.="if($sql_tbl[products].descr like '%". $search_word ."%',$topscore,0) + "; //add individual word score - LNJ $topscore=$topscore-$scoredesc;//Descrement individual score for word - LNJ } } if (!empty($data["by_longdescr"]) && count($search_words)>0) { $scorestr.="if($sql_tbl[products].fulldescr like '%". $data["substring"] ."%',3,0) + "; //Add high score for exact match - LNJ $topscore=2; $scoredesc=$topscore/count($search_words); //Get decrementing number for scores - LNJ foreach($search_words as $search_word){ $scorestr.="if($sql_tbl[products].fulldescr like '%". $search_word ."%',$topscore,0) + "; //add individual word score - LNJ $topscore=$topscore-$scoredesc;//Descrement individual score for word - LNJ } }

See if you can find optimal settings for the results you're looking for.
__________________
GetItCheap.com
x-cart v4.0.17

TheNewDonald.com - Internet Marketing Blog
Reply With Quote