View Single Post
Old 04-16-2005, 03:35 AM   #1
Charter
Head Mole
 
Charter's Avatar
 
Join Date: May 2003
Posts: 2,539
Change Weight per Keyword to Reorder Search Results

This mod is for v.1.8.7 and v.1.8.8 RC1. It allows you to adjust the keyword weights, which in turn will reorder the search results to your preference.

Add the following to your language pack:
Code:
'adjust_weights' => 'Adjust weights',
'merge_yes'     => 'The engine table merge rows procedure is completed',
'merge_no'      => 'No merge procedure was performed on the engine table',
'merge_none'    => 'Be sure you have enough resources before doing this.',
'merge_title'   => 'Merge Engine Table Rows',
'merge'         => 'Merge',
'refine_msg1'   => 'There were more than 100 results. Consider refining your search.',
'refine_msg2'   => 'There were no results. Consider refining your search.',
'siteurl'       => 'SiteURL',
'path'          => 'Path',
'file'          => 'File',
'keyword'       => 'Keyword',
'spiderid'      => 'SpiderID',
'keyid'         => 'KeyID',
'weight'        => 'Weight',
If you are using v.1.8.8 RC1 remember to convert the language pack to UTF-8 (here is an example - see UPGRADE.txt in the v.1.8.8 RC1 package for further details):
Code:
iconv -f windows-1251 -t utf-8 -o ru-language.phpx ru-language.php &
Add the following to admin/index.php:
Code:
<a href="adjust_weights.php"><?php print phpdigMsg('adjust_weights') ?></a><br/>
Unzip/FTP the attached file (ASCII mode) to the PhpDig admin directory.

Do not run the merge option unless you are absolutely sure that you have enough resources to do so. As always, make a database backup before running adjust_weights.php just in case.

You will be presented with various fields that you may search. Note that 'keyword' means one word, not key phrase. PhpDig weights per word so there is no key phrase weighting available.

Once you get results, you can set keyword weights anywhere from 1 (lowest) to 9999 (highest) and that will adjust the search results accordingly, highest showing first in the search results.
Attached Files
File Type: zip adjust_weights.zip (3.1 KB, 16 views)
__________________
Responses are offered on a voluntary if/as time is available basis, no guarantees. Double posting or bumping threads will not get your question answered any faster. No support via PM or email, responses not guaranteed. Thank you for your comprehension.
Charter is offline   Reply With Quote