View Full Version : Client question: intelligent ranking
lukemack
11-04-2005, 03:49 AM
Hi,
I am evaluating whether to use phpdig for a client's website. He has asked me the following:
I have heard that
> some sophisticated search engines remember which sites were chosen by
> users from the search lists produced in a word search and use this to
> influence the "top tenness" of results. Does this tool have any of
> this capability or is there a tool that does?
I'd be grateful if somebody could answer this for me. I think what they are asking is - can phpDig rank results according to which searches have been the most popular?
Many thanks,
lukemack.
Charter
11-06-2005, 10:19 AM
PhpDig doesn't rank based on most popular searches; it basically ranks on number of occurrences, but there is a mod here (http://www.phpdig.net/forum/showthread.php?t=1857) that lets you change weight per keyword to reorder search results.
lukemack
11-06-2005, 10:24 AM
many thanks for your reply. do you know of a search tool which does have this functionality?
Charter
11-06-2005, 01:52 PM
I don't know of such a script, but you could try the following untested code with PhpDig version 1.8.8 RC1 so that word weight is bumped on each reindex according to what is in the logs table.
In robot_functions.php find:
//New index record
if ($it == 0) {
$sqlvalues .= "($spider_id,$key_id,$value)";
$it = 1;
}
else {
$sqlvalues .= ",\n($spider_id,$key_id,$value)";
}
And replace with the following:
//New index record
if ($it == 0) {
$sqlvalues .= "($spider_id,$key_id,$value)";
$it = 1;
}
else {
$weight_select = "SELECT COUNT(*) FROM ".PHPDIG_DB_PREFIX."logs WHERE l_includes = '".$key."'";
$weight_query = mysql_query($weight_select,$id_connect);
$weight_bump = mysql_fetch_row($weight_query);
$weightbump = intval($weight_bump[0]);
$value += $weightbump;
$sqlvalues .= ",\n($spider_id,$key_id,$value)";
}
lukemack
11-07-2005, 03:11 AM
thanks - that sounds good but am a little reluctant to try untested code on a client site.
do you know of anyone who has tried this?
Charter
11-07-2005, 11:40 AM
I don't know of anyone who has tried the posted mod, but if your client wants to word bump based on searches use:
$weight_select = "SELECT COUNT(*) FROM ".PHPDIG_DB_PREFIX."logs WHERE l_includes = '".$key."'";
Otherwise, if your client wants to word bump based on clicks use:
$weight_select = "SELECT COUNT(*) FROM ".PHPDIG_DB_PREFIX."clicks WHERE c_val = '".$key."'";
vBulletin® v3.7.3, Copyright ©2000-2012, Jelsoft Enterprises Ltd.