Site Search Engine Tracent Technologies


This page provides help with the Tracent Site Search Engine. You can use this tool to provide your web site visitors with the ability to search selected web pages or your entire web site for a key word or phrase. If you have questions or encounter problems using this tool, please contact webmaster@tracent.net.


Usage Instructions

The search engine can be very simple to use by accepting defaults for everything. You can add a search capability to your site by simply including a hyperlink like this:

Site Search
<A HREF="/cgi-bin/sitesearch.asp">Site Search</A>

There are several parameters (discussed below) which you can use to customize searches, but all parameters are optional.

To put a search form on one of your web pages like this:
Enter a Key Word or Phrase

Include this HTML code in your page:

<FORM ACTION="/cgi-bin/sitesearch.asp" METHOD="POST">
<INPUT TYPE="HIDDEN" NAME="Template" VALUE="/webhelp/searchtemplate.tpl">
<INPUT TYPE="HIDDEN" NAME="SiteList" VALUE="/webhelp/sitelist.txt">
<INPUT TYPE="HIDDEN" NAME="MaxHits" VALUE="5">
<TABLE BORDER=3 BORDERCOLOR="RED" CELLSPACING=2 CELLPADDING=4 BGCOLOR="BLACK">
    <TR>
        <TD BGCOLOR="WHITE" ALIGN="CENTER">
            <FONT FACE="Arial, Helvetica" SIZE=3 COLOR="BLACK">
            Enter a Key Word or Phrase<BR>
            <INPUT TYPE="Text" SIZE=30 NAME="KeyWord"><BR>
            <INPUT TYPE="SUBMIT" NAME="SUBMIT" VALUE="Start Search">
        </TD>
    </TR>
</TABLE>
</FORM>



The input fields shown above have the following meanings:

Field Expected Value Comments
Template A web page template file name used to display search results. This web page template is optional. If you do not specify one, or the template cannot be found, then this default page will be used. See below for the special tags that can be used in templates.
SiteList The name of a file containing the web pages to be included in your search. This parameter is optional. If you do not specify a site list file, or if the one specified is not found, a new file named sitelist.lst will be created which contains the names of all files with an extension of HTM or HTML in your web site root directory (or the sub-directory from which the search engine was linked) and sub- directories below. This is the site list used for the example search above.
MaxHits A number from 1 to 50 indicating the number of hits per page which should be returned. If you do not specify the maximum number of hits per page, a value of 20 will be assumed.
KeyWord The word or phrase to be searched for This value will typically be contained in an <INPUT> field on a form for your visitors to use. However, if no key word or phrase is inlcuded, the default template will display an input form. Key words are not case sensitive. Occurances of words or phrases which match those in the key word or phrase will be counted and returned as "hits".



Special Template Tags


If you do not use the default template, you can create your own web page templates to completly control how the search results appear. The template is a standard HTML page with several special tags you can use to incorporate the search results.
Tag Tag Type Comments
<$Time$> Value substitute The current server time will be displayed like this: 11:58:30 AM where ever this tag occurs in your template.
<$Date$> Value substitute The current server date will be displayed like this: 5/18/2012 where ever this tag occurs in your template.
<$KeyWord$> Value substitute The key word or phrase being searched for will be displayed where ever this tag occurs in your template.
<$SiteList$> Value substitute The name of the site list file used to determine web page files to be searched will be displayed where ever this tag occurs in your template. This is typically used for adding a "New Search" form to your seach results. See the default template for an example.
<$Template$> Value substitute The name of the template file used to generate the search results web page. This is typically used for adding a "New Search" form to your seach results. See the default template for an example.
<$MaxHits$> Value substitute The maximum number of hits to be displayed per page. This is another value that would be used to provide hidden input fields for a "New Search" form.
<$StartAt$> Value substitute The first hit number to display on the page. This value is used when multiple pages of hits are returned.
<$WebSite$> Value substitute This value will return your web site address where ever the tag occurs in your template. A web site would be the www.tracent.net portion of a URL.
<$SitePage$> Value substitute The web page from which the search engine was linked. You can use this value in your template to provide a "Back" button link, bringing your visitor back to the page they viewed before the search results page.
<$NumHits$> Value substitute The total number of hits found.
<$BeginHaveHits$> Block Begin This tag marks the beginning of a section within your template. Everything between this tag and the <$EndHaveHits$> tags will be ignored unless the search found at least one hit.
<$EndHaveHits$> Block End This tag marks the end of a section within your template.
<$BeginMorePages$> Block Begin This tag marks the beginning of a section within your template. Everything between this tag and the <$EndMorePages$> tags will be ignored unless the search found more than one full page of hits (using <$MaxHits$> hits per page).
<$EndMorePages$> Block End This tag marks the end of a section within your template.
<$BeginNextPage$> Block Begin This tag marks the beginning of a section within your template. Everything between this tag and the <$EndNextPage$> tags will be ignored unless there are additional hit pages beyond the currently displayed page.
<$EndNextPage$> Block End This tag marks the end of a section within your template.
<$NextPageURL$> Value substitute The URL to display the next page of results will be included in the results page where ever this tag occurs within your template. This is typically used as a hyperlink for a "Next Page" button.
<$BeginPriorPage$> Block Begin This tag marks the beginning of a section within your template. Everything between this tag and the <$EndPriorPage$> tags will be ignored unless there were additional hit pages displayed before the currently displayed page.
<$EndPriorPage$> Block End This tag marks the end of a section within your template.
<$PriorPageURL$> Value substitute The URL to display the prior page of results will be included in the results page where ever this tag occurs within your template. This is typically used as a hyperlink for a "Prior Page" button.
<$BeginNoHits$> Block Begin This tag marks the beginning of a section within your template. Everything between this tag and the <$EndNoHits$> tags will be ignored unless there were no hits found during a search. This allows you to have a "Sorry, try again" page.
<$EndNoHits$> Block End This tag marks the end of a section within your template.
<$BeginNoKeyWord$> Block Begin This tag marks the beginning of a section within your template. Everything between this tag and the <$EndNoKeyWord$> tags will be ignored unless there was no key word or phrase submitted. This allows you to display an error message or provide an input form for your visitors to enter a search word.
<$EndNoKeyWord$> Block End This tag marks the end of a section within your template.
<$BeginHits$> Repeting Block Begin This tag marks the beginning of a repeating section within your template. Everything between this tag and the <$EndHits$> tag will be repeated for each hit to be displayed on the results page. (This section is ignored if there were no hits found.) This is where you would typically setup a table to display the results of the search.
<$HitNumber$> Repeting Value substitute The current hit number (sorted by key word occerances) is displayed where ever this tag occurs in your template. This tag is only useful between the <$BeginHits$> and <$EndHits$> tags.
<$HitsInDoc$> Repeting Value substitute The number of times the key word or phrase occurred within the target document is displayed where ever this tag occurs in your template. This tag is only useful between the <$BeginHits$> and <$EndHits$> tags.
<$HitTitle$> Repeting Value substitute The HTML page title (from the <TITLE> tags) is displayed where ever this tag occurs in your template. If no title is defined within the HTML page, the words "No Title" are displayed. This tag is only useful between the <$BeginHits$> and <$EndHits$> tags.
<$HitURL$> Repeting Value substitute The relative URL of the hit document is displayed where ever this tag occurs in your template. Note that in order to use a fully qualified URL, you will need to add "http://" and <$WebSite$> to the URL provided with this tag. This tag is only useful between the <$BeginHits$> and <$EndHits$> tags.
<$NextHit$> Repeting Value Advance This tag does not display anything. Rather it causes all subsequent tags within the <$BeginHits$> and <$EndHits$> section to focus on the next hit number. This is useful if you want to display multiple columns of results or use alternating background colors, etc. This tag is only useful between the <$BeginHits$> and <$EndHits$> tags.
<$EndHits$> Repeting Block End This tag marks the end of a repeating section within your template.


Web Help Tracent Home




© 1999, Tracent Technologies, Inc.
All rights reserved.