search CGI Command

Purpose

The search gateway uses a search engine to perform keyword searches on the entire CS Department site. Search results can be pruned to a sub-tree.

Syntax

Href
/cgi-bin/search
Method
POST or GET
Required Parameters
keywords
A space-separated list of keywords. Logical combinations of keywords can be constructed using and, or, near and parenthetical grouping.
Optional Parameters
maxhits
The maximum number of hits to return. If not set, or set to "all", all hits are returned.
prune
The absolute path of a sub-tree of the web which is used to filter hits. Searches are always performed on the entire web site, but this parameter allows the results to be restricted to a sub-area.
success_page
The file name of a .html file in the web which will be used as a template for all successful responses.
error_page
The file name of a .html file in the web which will be used as a template for all error responses.

Template Pages

The parameters success_page and error_page can be used to customize the response page of a search without the need to do any cgi programming. Search reads in the template page and performs simple text-replacement on certain special strings. The result is sent to the form-submitter as the response.

The text which is replaced in the template takes the form of HTML comments. Each is of the form

        <!--string-->
where "string" is the name of the replacement text.

success_page Text Replacement

<!--base-->
The base path of the replacement page. Use this as the value of the base attribute of the <body> tag in the template to enable the use of relative file references within the page.
<!--keywords-->
The keywords, as they were provided in the original query.
<!--results-->
The results of the search, in the form of an html ordered list (<ol>).

error_page Text Replacement

<!--base-->
The base path of the replacement page. Use this as the value of the base attribute of the <body> tag in the template to enable the use of relative file references within the page.
<!--error-->
The text of the error message.

Examples