skip to main content
Modifying the Search Ranking
The search results are displayed in the Search tab when a user types a word to search for and clicks Go. The search results are sorted by the relevancy ranking, which is calculated based on the scoring preference defined for the HTML tags in the wwhelp_files.xml file. By default, WebWorks Help assigns relevancy rankings based on where in a topic a particular item is found.
For example, if you set the scoring preference, or weight, for Heading 1 to 25 and you set the weight for Heading 2 to 15, then any search term found in a Heading 1 returns a higher relevancy ranking than if the search term is found in a Heading 2.
The following scenario illustrates how the relevancy ranking is calculated:
If you search for the word popup, and that word appears in both a Heading 1 and a Heading 2 on one page, and in a Heading 1 on another page, the search returns two results sorted by the relevancy ranking.
To get the relevancy ranking, WebWorks Help takes the score of each search result and divides it by the highest score found. To get the score of each search result, the scoring preference for each HTML tag is used.
For example, Heading 1 has a scoring preference of 25 and Heading 2 has a scoring preference of 15. If the word “popup” appears in a Heading 1 and a Heading 2 on a topic page, then the score for that word on that page is 25+15=40. If the word “popup” appears in a Heading 1 on another topic page, then the score for that word on that page is 25. Therefore, if 40 is the highest score that a search for “popup” returns, the relevancy ranking of the first search result is 100%=40/40x100%, and the relevancy ranking for the second search result is 38%=15/40x100%.
To modify the relevancy ranking for search results
1. In your Stationery design project, on the View menu, click Project Directory. For more information about override files and locations, see Stationery, Projects, and Overrides.
2. If you want to override the message appearance for all WebWorks Help targets, create the Formats\WebWorks Help 5.0\Transforms folder in your projectname folder, where projectname is the name of your ePublisher project.
3. If you want to override the message appearance for one WebWorks Help target, create the Targets\WebWorks Help 5.0\Transforms folder in your projectname folder, where projectname is the name of your ePublisher project.
4. Copy the wwhelp_files.xml file from the following folder to the Transforms override folder you created within your project folder:
Program Files\WebWorks\ePublisher Designer\Formats\WebWorks Help 5.0\ Transforms
5. Open the wwhelp_files.xml file you copied to your project override folder.
6. Find the following block of code:
<ScoringPrefs>
  <meta name="keywords" weight="100"/>
  <meta name="description" weight="50"/>
  <meta name="summary" weight="50"/>
  <title weight="20"/>
  <h1 weight="15"/>
  <h2 weight="10"/>
  <caption weight="10"/>
  <h3 weight="7"/>
  <th weight="5"/>
  <h4 weight="5"/>
  <h5 weight="4"/>
  <h6 weight="3"/>
  <h7 weight="2"/>
</ScoringPrefs>
7. Modify the weight attributes for any tags, such as h1 and h2, you want to change.
8. Save and close the wwhelp_files.xml file.
9. Regenerate your project to review the changes.
Was this helpful?
Last modified date: 11/30/2021