[Top] [Prev] [Next] [Last]
Download PDF:   US   UK
Download Postscript:   US   UK
Stronghold Web Server 2.4.1 Administration Guide

Chapter 12

Indexing and Searching

This chapter explains how to use SWISH and WWWWAIS, Stronghold's standalone indexing and search facilities, including how to




SWISH and WWWWAIS

Stronghold comes with two standalone programs for indexing your site and offering search capabilities to users:



Configuring SWISH

Stronghold's installation program places SWISH in ServerRoot/swish, and its configuration file is ServerRoot/conf/swish.conf. Like httpd.conf, it's a simple text file, but it does not use wrappers. The default configuration file is included in Appendix D.

This section explains the SWISH configuration directives, including ReplaceRules and FileRules, the directives that set the indexing parameters.



IndexDir



IndexFile



IndexOnly



IndexReport



FollowSymLinks



NoContents



IgnoreWords



IgnoreLimit



IndexName



IndexDescription



IndexPointer



IndexAdmin



ReplaceRules



FileRules



Configuring WWWWAIS

Stronghold's installation program places WWWWAIS in ServerRoot/cgi-bin, and its configuration file is ServerRoot/conf/wwwwais.conf. Like swish.conf, it's a simple text file that does not use containers. The default configuration file is included in Appendix E.

This section explains the WWWWAIS configuration directives.



PageTitle



SelfURL



MaxHits



SortType



AddrMask



SwishBin



SwishSource



SourceRules



WaisSource



UseIcons



IconUrl



TypeDef




Creating a Site Index

Each site on your server platform requires its own site index. For example, if you have many virtual hosts, users who accesses one host must be able to search that host without receiving results from other hosts. Before you can use the WWWWAIS search facility, you must use SWISH to create a site index for each virtual host on your server. You must also update these indexes periodically to ensure that search results are current. With a little creativity, you can create scripts that automate these tasks for you.

The SWISH executable is ServerRoot/swish/swish. To create a site index, run SWISH from the command line, using the following flags to specify options:

Flag Description
-i dir|file Create an index of the specified directory or file. Use this flag to index the directory that contains an individual virtual host's files. SWISH indexes directories recursively. You can specify multiple directories or files, separated by spaces.
-w word1 [word2 . . . ] Search only for the specified keywords. You can use "and," "or," "not," and parentheses. The search is case-insensitive, and SWISH evaluates your criteria from left to right.
-t H|B|t|h|e|c Search only the specified HTML tags:
  • H = <HEAD>

  • B = <BODY>

  • t = <TITLE>

  • h = <Hn>

  • e = <EM>

  • c = <!-- comment --!>

-f filename1 [filename2] Create or search the specified file. If you are indexing, you can specify only one file-the index file for SWISH to create. The default is index.swish in the current directory. If you are searching, you can give a list of files to search.
-c filename Index using the specified configuration file. You can use this flag to implement custom SWISH configurations for individual hosts, or to eliminate the need for command-line flags by including all options in the configuration file.
-v 0|1|2|3 Run with the specified level of verbosity. 0 is silence, and 3 is the most verbose. The default is 3.
-l Follow symbolic links when indexing.
-m n Return no more than n, the maximum number of results. When n is not specified, SWISH assumes 40. To set no limit on the number of results, specify 0 or "all," or omit this flag. The value given in the configuration file overrides any value you specify with this flag.
-M index1 index2 . . . filename Merge the specified index files into one file, specified by filename. SWISH removes all redundant data during this operation.
-D filename Decode the specified index file.
-V Print the current version number.

Once you have an index file for a host, any HTML search interface for that host must reference the appropriate index file. Make sure the administrator of each virtual host has access to that host's index file, and to the instructions contained in the next section, "Creating a Search Interface."




Creating a Search Interface

WWWWAIS searches the site indexes created by SWISH. It supports the Boolean operators AND and OR, and can use either GET or POST. The basic form that passes search parameters to WWWWAIS looks like this:

<FORM METHOD=GET ACTION="/cgi-bin/wwwwais?sourcedir=/usr/local/www/htdocs/vhost/swish&source=index.swish"
Search for:
<INPUT TYPE=TEXT NAME="keywords" SIZE=40>
<INPUT TYPE=SUBMIT VALUE="Search">
</FORM>

You can customize any search form by appending search options to the URL in the ACTION field. You can use as many options as you like in a single form. Options strings must be separated from the ACTION path by a question mark (?). Options must be separated from each other by ampersands (&). For example:

ACTION=/cgi-bin/wwwwais?source=index.src&keywords=sample+search

The rest of this section lists the available search options. Many of them are equivalent to certain configuration directives and can be used to override the settings in the configuration file. If you have multiple virtual hosts, it's important to specify the source index file in each search form using the sourcedir and source options. If you have only one host, you can simply set the source index in the configuration file.



sourcedir



source



maxhits



keywords



isindex



sorttype



version



host



port



useicons



iconurl



selection



searchprog






[Top] [Prev] [Next] [Last]
© 1998 C2Net International
Feedback: stronghold-docs@c2.net
C2Net Logo