htsearch

ht://Dig © 1995-1998 Andrew Scherpbier
Please see the file COPYING for license information.


HTML Form

The primary interface to htsearch is through an HTML form. When the form is submitted, the htsearch program will take values from the form and perform the actual search. The search can be modified in many ways with either hidden input fields or other HTML form tags. Study the examples to get a feel of what things are possible.

The HTML form is expected to contain at least an input text field named words. This is where the user will enter the search words. Other values are also recognized but have appropriate defaults in case they are not used:

config
Specifies the name of the configuration file. The name here is the name without the path and without the .conf at the end. This file is assumed to be located in the CONFIG_DIR directory.
The default is htdig
exclude
This value is a pattern that all URLs of the search results cannot match.
The default is blank.
format
This specifies the name of the template to display the search results in. There are two builtin templates named builtin-long and builtin-short which can be used, but any number of custom templates can also be defined. Find out more about the templates in the Output Templates section.
The format value can be specified as either a hidden input field or a drop down menu.
The default is specified by the template_name attribute in the configuration file.
keywords
Used to specify a list of required words that have to be in the documents. This list of words is added to the normal words value using logical "and"s.
An example use for this value is to make it a drop down menu with a limited set of predetermined categories or keywords to restrict the search. This can be very useful for very structured pages.
matchesperpage
Specifies how many matches will be displayed on each page of results.
The default is specified by the matches_per_page attribute in the configuration file. Since this value has to be a number, it either needs to be set using a hidden input field or a with a drop down menu.
method
This can be one of and, or, or boolean. It determines what type of search will be performed.
The default is specified by the match_method attribute in the configuration file. It is quite useful to make this item a drop down menu so the user can select the type of search at search time.
page
This should normally not be used. It is generated by the paged results display.
restrict
This value is a pattern that all URLs of the search results will have to match. This can be used to restrict the search to a particular subtree or subsection of a bigger database.
The default is blank.

Andrew Scherpbier <andrew@contigo.com>
Last modified: Thu Jan 2 00:01:14 PST