Adding a Hit-Highlighting Link to a Results Page

Note

Indexing Service is no longer supported as of Windows XP and is unavailable for use as of Windows 8. Instead, use Windows Search for client side search and Microsoft Search Server Express for server side search.

 

The hit-highlighter (Webhits.dll) comes with a ready-made results page (Query.htx). This results page includes a link to Webhits for each document returned. To add a link to an existing page, modify the .htx file by inserting the following line where you want the link to appear:

<a href="http://<%server_name%<execute-permission vpath/Null.htw>?CiWebhitsFile=<%escapeURL vpath%>&amp; 
CiRestriction=<%escapeURL CiRestriction%>"><b>Highlight Hits</b></a><BR>
 

Here, server_name is a variable storing the name of the server on which the web server is located, and CiRestriction is the variable storing the query. You escape the restriction through the EscapeURL keyword, as shown in the sample query.