[an error occurred while processing this directive]
Invoking a Glimpse Search With a Form

You can invoke a Glimpse search using the form processor. This can be useful if you want to do some special validations on the user's input search parameters before invoking the search, or in case you want to use a high-level search form. This allows the user to select which index to search from using radio buttons, constructing search terms from multiple option lists, etc..

To invoke a GGlimpse search from the form processor, set the ACTION of the search form to http://webcom.com/~webcom/cgi-bin/form (instead of http://webcom.com/~webcom /cgi-bin/glimpse), and create a form processor configuration file to process the form. In the configuration script, after you've performed the validations on the form input and set the Glimpse search parameters, you can invoke the Glimpse search engine by returning to the client a Location header which has the URL of the limpse cgi services with all the search parameters tacked on as a cgi parameter string. For example:


format screen nh
Location: http://webcom.com/~webcom/cgi-bin/glimpse?glimpse_search=$glim
pse_search&userid=your_userid&glimpse_directory=www&glimpse_show_li
nes=on&glimpse_type=g&glimpse_boolean_line=on&glimpse_case_sensitive=$glim
pse_case_sensitive

.

NOTE: When specifying a complete path in the parameters section of the URL (eg: glimpse_directory=www/phone_book/), you must 'escape' the slashes (eg: glimpse_directory=www%2Fphone_book%2F) by replacing them with %2F. Similarly, you must replace spaces with the plus sign (+). The reason you must substitute the obscure characters for the 'natural' ones is because the URL specification states that slashes and other characters must only be used to designate hosts and directories. For a common list of characters that must be escaped and their replacements, click here.

When the browser receives the above location header, it invokes the glimpse cgi services with the parameters listed. The result page is the same as though the Glimpse search had been invoked from a form with the action set to the Glimpse URL and fields for each of the parameters. Presumably, you've done some validations and/or constructed the search pattern or other search terms previously in your form processor configuration script before invoking the search with a Location header.

The above is just one example of a Glimpse search dynamically invoked from the WebCom form processor. Your actual implementation may use a different set of parameters for the Glimpse search (as long as the required parameters for a Glimpse search are present).

[an error occurred while processing this directive]