Knowledgebase Home Page  >  SearchUnit
Search the Knowledge Base
How can I boost certain page weights, to improve their result ranking?
https://keyoti.com/kb/Default.aspx?ToDo=view&questId=217&catId=54

Options

Print this page
Email this to a friend
In the situation where certain pages are more important/useful than others, it may be desirable to boost their ranking beyond the number of keyword matches.
 
For example, there are 3 documents, a.html, b.html, c.html each contain 1 word ("test").
 
Assume that for whatever reason b.html is more important/useful than the other 2 documents, and we therefore want any search for 'test' to have b.html come up first.
 
 
This article includes a very simple plug-in project (at the bottom) which can be used to modify word weighting during indexing, based on a meta-tag.  The use of meta tags is applicable to HTML based documents, but 'boosting' can also be applied to any other document through the use of 'custom data'
 
 
 
1. Add the following meta tag to any HTML documents which should be boosted;
 

<meta name="Keyoti_Search_Custom_Data" content="N" />

replacing 'N' with an integer which indicates the factor by which the document is boosted.
 
If you are already using a custom data meta tag, then you can delimit the data and add the boost as a field, eg. "existing_data|boost=N", and then modify the plugin to parse out the boost data.
 
 
2. Build the plug-in project (it's important that it is compiled against your current version of the search assemblies).
 
3. Use the plug-in DLL by adding it to the Index Directory and setting the name of the DLL in Configuration.EventHandlerAssemblyPath.
 
Eg.
Configuration.EventHandlerAssemblyPath = "PageBooster_Plugin.dll";

It is also possible to place the DLL anywhere you like (outside the Index Directory), please see this article.

4. Index your documents and it should use the plug-in.

 

Troubleshooting:

If you do have trouble with the plug-in, you can verify it works etc by following the information below.

Log Files

To check your extension plug-in is working as expected you can view the log file CentralEventDispatcher.txt under your Index Directory, which will be updated as soon as anything is attempted using the configuration (eg. edit settings, start a tool). You will need to ensure Logging has been enabled in the configuration settings before using your plug-in.

Example of successful entry;
08/14/2008 10:51 Success, initialized external event handler assembly @ C:\Inetpub\wwwroot\Search_Extension_Plugin\bin\SearchExtensionPlugin.dll

Notes

CAS (security permission) issues:

If accessing an external assembly (ie. CustomDataSetProvider or ExternalEventHandler) in anything below Full Trust, the external assembly must be located under the application directory.

External Assembly Location Tip:

When working with a plug-in DLL and the Admin Web App., place the plug-in DLL in the application BIN directory. This will make the DLL automatically updatable, without stopping the IIS service or killing the ASP.NET worker process.
If the plug-in is outside the application and it's subdirectories, ensure the ASPNET (IIS 5) or NetworkService (IIS 6) user can access the DLL, eg. run from command prompt

cacls "path to plug-in DLL" /E /G ASPNET:R

References To Search DLLs:

It is fine to reference the search DLLs, but attention must be paid to;
  • The plug-in assembly may only reference the exact same assemblies as those being used by the search applications - specifically if your applications are using Keyoti.SearchEngine.Core.DLL, then the plug-in will fail if it is referencing Keyoti2.SearchEngine.Core.DLL (reason being that the identical class names will not be compatible). Note: the Search Admin web application (under Pro) uses the .NET CLR 1 assemblies - therefore any plug-ins used must also reference the .NET CLR1 assemblies and not the CLR2 versions.
  • Like any assembly, the versions of the reference during compilation must match the version of the assembly located at run-time. Specifically, this means that when upgrading from one version of Search to another, any plug-in DLLs will need to be recompiled against the new version assemblies.

Related Questions:

Attachments: