Edit online

How to Exclude Certain DITA Topics from Search Results

There are several ways to exclude certain DITA resources from your WebHelp system's search results. This is useful if you have topics in your DITA map structure that you do not want to be included in search results for your WebHelp system. The first method involves setting a parameter in the WebHelp transformation scenario and the second involves setting an attribute for each DITA topic reference that you want to exclude.

Transformation Parameter Method

To exclude DITA topics from WebHelp search results using a transformation parameter, follow these steps:
  1. Create a simple text file that will contain your excluded file patterns. Each pattern must be on a new line. The patterns are considered to be relative to the output directory and they accept wildcards such as '*' (matches zero or more characters) or '?' (matches one character). For more information about the patterns, see https://ant.apache.org/manual/dirtasks.html#patterns.

    Example: Suppose that in your project, you want to exclude all files located in the resources directory and all files located in the topics directory that have a .bak file extension. You could create a simple text file (for example, named exclude.properties), and add the following lines:
    resources/*
    topics/*.bak
  2. Set the webhelp.search.custom.excludes.file parameter to specify the path to the file that contains the excluded file patterns (for example, exclude.properties in step 1). The parameter can be specified in the parameters section of the template descriptor file associated with your publishing template or in the Parameters tab of the transformation scenario dialog box in Oxygen XML Editor/Author.
  3. Run the transformation.

Search Attribute Method

The WebHelp Search engine does not index DITA topics that have the @search attribute set to no.

To exclude DITA topics from WebHelp search results using this attribute, follow these steps:
  1. Edit the DITA map and for any <topicref> that you want to exclude from search results, set the @search attribute to no. For example:
    <topicref href="../topics/internal-topic1.dita" search="no"/>
  2. Save your changes to the DITA map.
  3. Run your WebHelp system transformation.