Boosts

About this task

Result boosting allows you to mark certain documents as "boosted" and display them in a manner that distinguishes them from normal results. Generally this is done by placing them at the top of list above the normal results. In order to boost results, modifications are necessary at the source level to denote which documents to boost and, at the display level to actually display the boosted documents.

Procedure

  1. Modify the Source
    1. Simple Method:

      The simple method for boosting results is to add boost-display and boost-name attributes to the document(s) you wish to boost. The value of boost-display may be either boost-and-list or boost-only. Choosing boost-and-list will create a duplicate of the document and place it in a boost node leaving the original document in the list. Use this if you want to boost the document and have it appear in the results list. Choosing boost-only will remove the document from the result list and place it in a boost node. We recommend that you use the manual method, describe in the next item, when you only want selected items to appear in the boost area.

      The boost-name attribute specifies the name of the boost node the document should be added to. This allows you to add multiple documents to the same boost node. In your source, you can create an empty boost node so that you can assign the "precedence" and any other attributes you would like. Ex: <boost name="myboost" precedence="1"/> where @name is the same value that you used in the boost-name attribute of the documents. The precedence attribute in the boost is used by the rendering to display the boosts in the proper order.

    2. Manual, Boost-Only Method

      Another method for boosting results is to create your own boost node in the source and manually add documents to it. You can do this by adding extra steps to your parser that create the boost node and add document nodes to it. This approach adds complexity to your source, and the documents in the boost node will not have the search terms highlighted like normal search results. However, using this boost method provides more precise counts of matching documents in the clusters.

  2. Display

    Once you have created your boosts, they are accessible via the "boosts" variable in render-xhtml and can be called out in the display however you would like. The default behavior in render-xhtml is to display them above the results list. In render-xhtml you can see this in the <xsl:template match="list" type="render-list" mode="list-boost"> template which is called by <xsl:template match="list" mode="list-content">.

    By default, there is no support for handling boosted documents so you will need to create your own template to do so. If you use the existing framework you can create a template like the following:

      <xsl:template match="boost[@name='myboost']" mode="list-boost-node">
      ... your boost display code ...
      </xsl:template>

    Using a template along these lines will cause your boosted document(s) will appear above the normal results list.

Results

Tip: Sources whose results you boost are good candidates for being added to the list of default sources in the project-wide meta-search option query.pre-selected-sources. This option contains a space or comma-separated list of sources that will always be queried when any source is queried. This makes it easy to add default sources, such as high-value sources whose results you boost, or spelling correctors or key match sources that you want to use with all other sources.

You can set the value of this option from any Project's Metasearch tab.