Creating a Primary Parser

Procedure

  1. Click the List icon () beside the Sources entry in the left-hand Watson™ Explorer Engine administration tool navigation bar to display the list of available sources. Type binning-collection in the search box, or select binning-collection from the list to open that source.
  2. Next, click the Parser tab. A screen like the one shown in Figure 1 displays.
    Figure 1. Creating a Free XSL Parser
  3. Click Add Parser Component, select Free XSL from the scrollable list as the type of parser that you want to create, and click Add.
  4. In the screen that displays, select XSL as the Type of parser, and enter the following as the code of your XSL parser:
    <xsl:template match="/">
      <boost name="df" />
      <xsl:apply-templates select="//document" />
    </xsl:template>
    
    <xsl:template match="document">
      <document url="{@url}" boost-name="df" boost-display="boost-and-list">
        <xsl:copy-of select="*" />
      </document>
    </xsl:template>
    Note: This simple parser creates an empty boost node named df as a target for any document nodes or elements that you want to boost. The name that you assign to any boost node is completely arbitrary.
  5. Click OK to save your changes. The resulting parser should look like the one in the screen shown in Figure 2.
    Figure 2. A Completed Free XSL Parser

Results

After creating the boost node, this parser boosts all of the results that match your query, replacing existing document nodes for each search result with new nodes that provide the boosting-related attribute boost-display, and copies all of the content elements from the input document node. Because the boost-display attribute is set to boost-and-list, each document node is both added to the boost node and is also shown in the standard list of search results.

Don't worry, this fairly trivial parser is just a first step in learning about boosting. Subsequent examples will show how to boost selected search results, as well as how to boost nodes without reducing the amount of information that is provided about each search result.

To proceed with this tutorial, click Testing the Parser.