Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

156 lines
9.8 KiB

<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
<html>
<head>
<title>Microsoft Index Server: Hit Highlighting</title>
<meta name="GENERATOR" content="Microsoft FrontPage 1.1">
</head>
<body bgcolor="#FFFFFF">
<!--Headerbegin--><p align=center><a name="TOP"><img src="onepix.gif" alt="Space" align=middle width=1 height=1></a> <a href="default.htm#Top"><img src="toc.gif" alt=" Contents" align=middle border=0 width=89 height=31></a> <a href="scanhlp.htm"><img src="previous.gif" alt="Previous" align=middle border=0 width=32 height=31></a> <a href="idqhelp.htm"><img src="next.gif" alt="Next" align=middle border=0 width=32 height=31></a> </p>
<hr>
<!--Headerend--><p><a name="HitHighlighting"><font size=6><strong>Hit Highlighting</strong></font></a></p>
<p><!--Chaptoc--></p>
<blockquote>
<p><a href="#WebhitsSyntax">Hit-Highlighting Syntax</a> <br>
<a href="#FormattingConsiderations">Formatting Considerations</a> <br>
<a href="#SampleQuery">Sample Query</a><br>
<a href="#AddingaHighlightHitsLinktoaResultPage">Adding a &#147;Highlight Hits&#148; Link to a Result Page </a><br>
<a href="#Errors">Errors </a><br>
<a href="#FilesUsed">Files Used</a><br>
</p>
</blockquote>
<hr>
<!--ChaptocEnd--><p>When you query a document with Microsoft Index Server, the hit-highlighting feature shows you the exact portions of the
document that satisfies your query (if any). The highlighting generates an HTML page containing a list of the <em>hits</em>, with those
words making up the hit emphasized (by default, displayed in red and italicized). Each hit is displayed together with some of
the text that surrounds it in the document. Also, for each document in which a hit is found, you are given a link to the full text of
that document.</p>
<hr>
<h1><a href="#TOP"><img src="up.gif" alt="To Top" align=middle border=0 width=14 height=11></a><a name="WebhitsSyntax">Hit-Highlighting Syntax</a></h1>
<p>The hit highlighter (Webhits.exe) is a CGI executable file that you invoke from your browser. You must put it into a folder with
execute access. Here is the syntax:</p>
<blockquote>
<p>http://<em>servername/Path1/Path2</em>?<em>Params</em></p>
</blockquote>
<p>where</p>
<dl>
<dd><em>Path1</em> is the virtual path to Webhits.exe.</dd>
<dd>&#160;</dd>
<dd><em>Path2</em> is the virtual path to the document to be highlighted.</dd>
<dd>&#160;</dd>
<dd><em>Params</em> is any Webhits parameters to fine-tune the search.</dd>
</dl>
<p>You specify Webhits parameters as</p>
<blockquote>
<p><em>Param</em>=<em>Value</em>[&amp;<em>Param</em>=<em>Value</em>][&amp;<em>Param</em>=<em>Value</em>]</p>
</blockquote>
<h2>Webhits Parameters</h2>
<p>This section lists and describes the parameters that can help you fine-tune a query with Webhits.</p>
<h3>CiRestriction</h3>
<p>Format: <strong>CiRestriction</strong>=<em>Query</em></p>
<p>You must always specify this parameter. The value must be a string, specifying the <a href="qrylang.htm">query</a> 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 <strong>EscapeURL</strong> keyword, as demonstrated in <a href="#AddingaHighlightHitsLinktoaResultPage">Adding a
Hit Highlights Link to a Result Page</a>.</p>
<h3>CiQueryFile</h3>
<p>Format: <strong>CiQueryFile</strong>=<em>Physical path</em></p>
<p>This parameter is optional. If it is passed, CiQueryFile specifies the physical 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 &#147;No such property&#148; will be displayed.</p>
<h3><strong>CiHiliteColor</strong></h3>
<p>Format1: <strong>CiHiliteColor</strong>=<em>24-bit color mask</em></p>
<p>The mask takes the form 0x<em>HHHHHH</em>, where each <em>H</em> is a hexadecimal digit.</p>
<p>Format2: <strong>CiHiliteColor</strong>=<em>color</em></p>
<p>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.</p>
<h3><strong>CiBold</strong></h3>
<p>Format: <strong>CiBold</strong>=<em>value</em>, where <em>value</em> can be any non-null string.</p>
<p>This is an optional parameter, that if present, specifies that the highlighted text be displayed in bold. Any non-null value will turn
bold on.</p>
<h3>CiItalic</h3>
<p>Format: <strong>CiItalic</strong>=<em>value</em>, where <em>value</em> can be any non-null string.</p>
<p>This is an optional parameter, that if present, specifies that the highlighted text be displayed in italics. Any non-null value will
turn italics on.</p>
<hr>
<h1><a href="#TOP"><img src="up.gif" alt="To Top" align=middle border=0 width=14 height=11></a><a name="FormattingConsiderations">Formatting Considerations</a></h1>
<p>You can specify the Webhits parameters in any order, and you can include whitespace in any of the following places:</p>
<ul>
<li>After the question mark (?) and before the name of the Webhits parameter.</li>
<li>Between the name of the Webhits parameter and the equal sign.</li>
<li>Between the equal sign and the escaped value of the Webhits parameter.</li>
<li>After the escaped value of the Webhits parameter and the ampersand (&amp;) (if more than one Webhits parameter is
passed).</li>
</ul>
<h2>CGI Variables</h2>
<p>As a CGI application, Webhits relies on information stored in several CGI environment variables.</p>
<dl>
<dt>PATH_TRANSLATED</dt>
<dd>When the hit highlighter is invoked through a browser, this variable is set with the <em>physical</em> path of the document to be
highlighted.</dd>
<dd>&#160;</dd>
<dt>PATH_INFO</dt>
<dd>When the hit highlighter is invoked through a browser, this variable is set with the <em>virtual</em> path of the document to be
highlighted.</dd>
<dd>&#160;</dd>
<dt>QUERY_STRING</dt>
<dd>This variable is set with any information specified after the question mark. Webhits then parses to retrieve the Webhits
parameters.</dd>
</dl>
<hr>
<h1><a href="#TOP"><img src="up.gif" alt="To Top" align=middle border=0 width=14 height=11></a><a name="SampleQuery">Sample Query</a></h1>
<p>Putting together the information in the previous sections, suppose you want search for the author of a document greater than
100 bytes, and the author&#146;s name is George. To do that, send the following query:</p>
<blockquote>
<pre>@DocAuthor = George AND @size &gt; 100</pre>
</blockquote>
<p>You want to aim your query at this document:</p>
<blockquote>
<p>/Inetpub/Docs/Ideas.doc</p>
</blockquote>
<p>The virtual path to Webhits.exe is </p>
<blockquote>
<p>/Somepath/Webhits.exe ?</p>
</blockquote>
<p>Webhits.exe resides on the server MyServer. </p>
<p>Before the query string can be passed to Webhits, it must be escaped, resulting in:</p>
<blockquote>
<pre>@DocAuthor%20%3D%20George%20AND%20@size%20%3E%20100</pre>
</blockquote>
<p>Now, to hit-highlight the document, issue the following command:</p>
<blockquote>
<pre>http://MyServer/somepath/webhits.exe/inetpub/docs/ideas.doc?
CiRestriction=@DocAuthor%20%3D%20George%20AND%20@size%20%3E%20100</pre>
</blockquote>
<p><strong>Note</strong>&#160;&#160;&#160;Neither @size nor @DocAuthor are custom properties, so you do not need to specify an .idq file in this case.</p>
<hr>
<h1><a href="#TOP"><img src="up.gif" alt="To Top" align=middle border=0 width=14 height=11></a><a name="AddingaHighlightHitsLinktoaResultPage">Adding a &#147;Highlight Hits&#148; Link to a Result Page</a></h1>
<p>Webhits comes with ready-made result page (Queryhit.htx). This result 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:</p>
<blockquote>
<pre>&lt;a href=&quot;http://&lt;<code>%</code>server_name<code>%></code>&lt;vpath of webhits.exe&gt;&lt;<code>%</code>escapeURL vpath<code>%</code>&gt;?
CiRestriction=&lt;<code>%</code>escapeURL&#160;CiRestriction<code>%</code>&gt;&quot;&gt;&lt;b&gt;Highlight Hits&lt;/b&gt;&lt;/a&gt;&lt;BR&gt;</pre>
</blockquote>
<p>Here, <em>server_name</em> is a variable storing the name of the server on which Webhits.exe is located, and <strong>CiRestriction</strong> is the
variable storing the query. You escape the restriction through the <strong>EscapeURL</strong> keyword, as shown in the <a href="#SampleQuery">sample query</a>. </p>
<hr>
<h1><a href="#TOP"><img src="up.gif" alt="To Top" align=middle border=0 width=14 height=11></a><a name="Errors">Errors</a></h1>
<p>For a list of errors specific to the hit-highlighting feature, see <a href="errorhlp.htm#Hit-HighlightingErrors">Hit-Highlighting Errors</a> on the &#147;Error Messages&#148; page.</p>
<hr>
<h1><a href="#TOP"><img src="up.gif" alt="To Top" align=middle border=0 width=14 height=11></a><a name="FilesUsed">Files Used</a> </h1>
<p>Webhits uses query.idq, and installs the following files: </p>
<blockquote>
<p>\Inetsrv\Scripts\Samples\Webhits.exe<br>
\Inetsrv\Scripts\Samples\Queryhit.htx<br>
\Wwwroot\Scripts\Samples\Queryhit.htm</p>
</blockquote>
<!--Footerbegin--><hr>
<p align=center><a href="default.htm#Top"><img src="toc.gif" alt=" Contents" align=middle border=0 width=89 height=31></a> <a href="scanhlp.htm"><img src="previous.gif" alt="Previous" align=middle border=0 width=32 height=31></a> <a href="#TOP"><img src="up_end.gif" alt="To Top" align=middle border=0 width=32 height=31></a> <a href="idqhelp.htm"><img src="next.gif" alt="Next" align=middle border=0 width=32 height=31></a> </p>
<hr>
<p align=center><em>&#169; 1996 by Microsoft Corporation. All rights reserved.<!--Footerend--></em></p>
</body>
</html>