<http://host/dir/search=title>
the server will provide an HTML form (automatically generated or prepared by the maintainer) asking for a regular expression search term. When supplied the server will search the index.cache files in /dir and designated subdirectories for a items whose titles contain a match for the search term. An HTML document with a menu of these items is returned. Subdirectories are designated for recursive searching by an entry in directory record of the index file like
Subdirs=dir1,dir2,dir3
You can customize the message offered requesting a search term by creating an HTML form whose ACTION is the URL http://host/dir/search=title and which uses the GET method to return the search term with NAME=query.
Keywords=keyword1, keyword2, etc.
in the relevant document's record in the index file. The URL to use to cause this search to be done is
<http://host/dir/search=keyword>
<http://host/dir/search=synopsis>
5.4 Fielded searches for user supplied fields
The maintainer can supply up to 20 additional field values associated
with a document. These are used for searching purposes in the same
way that Keywords are. This is intended to give some additional
"keyword like" fields, for example, document author or document id
number. It works exactly like keywords except these
values are not extracted from HTML files, but must be created with
a line like
Field3=any text here
in the index file. The '3' in this example can be replaced with any number from 0 to 19. The URL to use as the ACTION in a form or simply to invoke the search in the example above is
<http://host/dir/search=field3>
Like keyword and title searches the search term for a fielded search can be any grep-like regular expression.
The URL to use as the ACTION in a form or simply to invoke the search is
<http://host/dir/search=context>
It is possible to mark HTML documents with comments so that only part of them is searched. This is done with lines consisting of the comment <!-- #search_off --> which turns off searching until the line consisting of <!-- #search_on --> is encountered.
<http://host/dir/search=grep>
<http://host/dir/search=line>
The URL's to invoke these searches on file foo are
<http://host/dir/foo;search=context>
<http://host/dir/foo;search=grep>
The reason for this is efficiency. Context, grep and line searches are not a replacement for WAIS, glimpse or some other indexed search engine. The intent of these searches is to allow a full text search of a single conceptual HTML document that is made up of a number of files with links. These searches work great with something like the HTML2.0 spec (see http://hopf.math.nwu.edu/html2.0/) which consists of 39 files of moderate size, but they would be very slow with 1000 files spread out in a data hierarchy. For that you really need an indexing search engine.
On the other hand, all of the searching methods listed above are built into the server and require no additional effort for the maintainer. You don't need to produce or maintain an index. They are simply referenced with URLs like <http://host/dir/search=context> where /dir is any directory containing files to be served and an index.cache listing them. Of course search permission can be denied for any directory or any file contained in that directory.
The URL to invoke this search on file foo
<http://host/dir/foo;search=list>
Then in the index file in the directory dir you should have a line like
Search-Module=/full/path/to/searchmod
The program searchmod should read the environment variable QUERY_STRING and return a partial HTML document. The typical case would be the program returns an unordered list of anchors to documents containing a match to the query string. This list can be wrapped by including a Searchwrapper directory record. If it is not, then a default wrapper with text like "Here are the matches for your search" is supplied.
For more information see the chapter on modules.
<form action="search=mode" method="GET"> Enter your search term <input name="query" size=15> <input type="submit" value="Search"> by <input type="radio" name="mode" value="title" checked> title or <input type="radio" name="mode" value="keyword"> keywords </form>will execute either a title or a keyword search depending on whether the user checks the radio button for "title" or "keyword". The URL requested will end with "search=mode", but actually it could be anything since the "mode=title" (if that is what is checked) which will be in the query part of the URL will override whatever follows "search=" in the base URL.
The line
Searchwrapper=swrap.htmlspecifies that the HTML file swrap.html in the current directory should be used as a wrapper for the output of all searches on this directory (if it is a directory record entry) or file (if it is a file directive). This wrapper differs from other wrappers in that it can have only a single <!-- #include --> line. An unordered list of anchors to the matching items will be inserted at the location of this line. You can, of course, insert the client supplied search term by use of the line <!-- #query --> in this file.
The remainder of this file can be anything you wish and is often an HTML form allowing subsequent searches.
If a search fails to find any matches then a default HTML response indicating this is sent. This response can also be customized but only if a Searchwrapper is also used. The line
Nomatchsub=foo.htmlspecifies that the HTML file foo.html in the current directory should be used for the output of all searches (title, keyword, context, grep, etc.) on this directory (or file if it is a file directive) which return no matches. If Nomatchsub is used and a Searchwrapper has not be defined an error is logged and the nomatchsub file is ignored.