Hit-Highlighting Syntax

The hit highlighter (Webhits.dll) is an Internet Server API (ISAPI) application that you invoke from your browser by referring to an .htw template file.

If you want the minimum formatting to appear in your results set, choose the default formatting in Webhits.dll. To choose the default formatting, specify Null.htw as the template file. This file need not exist.

Sample template files for Webhits output formatting are included in the installed samples as:

/Iissamples/Issamples/Oop/Qfullhit.htw
/Iissamples/Issamples/Oop/Qsumrhit.htw

Webhits Parameters

This section lists and describes the parameters that can help you fine-tune a query with Webhits.

CiBeginHilite, CiEndHilite

Format: CiBeginHilite=BeginTags & CiEndHilite=EndTags

Customize highlighted words in the query results. If you specify these tags, Index Server ignores all other formatting parameters CiBold, CiHiliteColor, CiItalic, and so on.


Important    You must match the BeginTags and EndTags with correct HTML formatting. Failure to do so will produce unpredictable results. When you specify these parameters in the query template file (.htx file), you must properly escape the tags. For example:


CiBeginHilite=<%escapeURL <font color="#FF0000"><em>%>&CiEndHilite=<%escapeURL </em></font> %>

The two parameters together in the above example make the highlighted words in the search results appear in red italics.

CiBold

Format: CiBold=value, where value can be any non-null string.

Specifies that the highlighted text be displayed in bold. Any non-null value will turn bold on. This parameter is optional.

CiCodepage

Format: CiCodepage=charset

Determines the character set in which hit highlighting results are displayed. This parameter is optional. For more information about CiCodepage, see Controlling How Results Are Displayed.

CiHiliteColor

Format1: CiHiliteColor=24-bit color mask

The mask takes the form 0xHHHHHH, where each H is a hexadecimal digit.

Format2: CiHiliteColor=color

where name is any of {red, green, blue, yellow, black}. This parameter is optional. It specifies the color used to highlight the text matching the restriction. If it is not specified, or if the format used does not match either of the above, Webhits defaults to red.

CiHiliteType

Format: CiHiliteType=[Full|Summary]

This parameter is optional. If not specified, Summary is the default.

Summary   Generates small excerpts of a document around the words that match the query specification.

Full   Generates the full text of a document, highlighting the words that match the query. Mainly for documents that contain mostly text, this option does not do full-fidelity highlighting. Only the text part of the document is extracted and highlighted. In addition, this option tags the highlighted text (hits) with bookmarks, allowing navigation between the hits. The first hit is bookmarked as #CiTag0 and the top of the generated document is tagged as #CiTag-1. To help navigate, double-angle bracket tags (<< and >>) surround each hit. Click the << tag to go to the previous hit, and click the >> tag to go to the next hit.

CiItalic

Format: CiItalic=value, where value can be any non-null string.

Specifies that the highlighted text be displayed in italics. Any non-null value will turn italics on. This parameter is optional.

CiLocale

Format: CiLocale =LocaleString

Specifies the locale to interpret the CiRestriction string. The output will also be generated by this locale. Valid values for the CiLocale string are in the Valid Locale Identifiers page. This parameter is optional.

CiMaxLineLength

Format: CiMaxLineLength=Number

Pre-formats the text with the <pre> and </pre> HTML tags. If a line length exceeds the specified number, it is broken at the next word boundary. This option works best when full hit-highlighting is chosen. This parameter is optional.

CiQueryFile

Format: CiQueryFile=Virtual path

Specifies the virtual path of the .idq file containing the [Names] section describing the custom properties. You must pass this parameter for all queries involving custom properties. If you try to hit-highlight a document with a query that has a custom property and you do not specify the appropriate .idq file, the error message “No such property” will be displayed. This parameter is optional.

CiRestriction

Format: CiRestriction=Query

Specifies the query for doing hit highlighting. The query string must be in escaped form, which means that spaces and other special characters have been converted to their respective ASCII codes. In an .htx file, the restriction can be escaped by using the EscapeURL keyword, as demonstrated in Adding a Hit Highlighting Link to a Results Page. This parameter is required.

CiUserParamNumber

Format: CiUserParamNumber=value, where value can be any non-null string.

Specifies any parameter available for Webhits, where Number is any number from 1 to 10. For example, CiUserParam1, CiUserParam3, CiUserParam5, and so on.

CiWebhitsFile

Format: CiWebhitsFile=virtual_path

Specifies the virtual path of the document to be hit highlighted. This parameter is required.

Note   The Secure Socket Layer (SSL) setting for the Webhits template (.htw file) and the setting for CiWebhitsFile must be the same, or else the CiWebhitsFile must have a setting of 0. If this is not the case, Webhits will fail with an appropriate an error message.

If your site requires all documents to be accessed only with SSL, be sure to set the same SSL access on the .htw file. If your site has some documents with SSL access required and others with no SSL access required, set the SSL access on the .htw file to be the same as those that require SSL access. Alternatively, you can create two .htw files (one for each type of document).


© 1997 by Microsoft Corporation. All rights reserved.