SWISH-E - Web Site Search Utility
A convenient method to allow clients to retrieve information from a
web site is by building an index of the web pages and providing search
capability. This may seem like a daunting task, but with a few tools
this task becomes very easy.
Normally web indexing and searching requires a complex, hard to use
and install WAIS-based solution, however a small yet powerful program
(which is based on SWISH written by Kevin Hughes), can be used to
fulfill your web indexing and searching needs.
To install SWISH-E on your Virtual Server, connect via
Telnet or SSH
and run this command:
% vinstall swish-e
Index Your Web Site
To create a SWISH-E index of your Web site, do the following.
Change your current working directory to your swish-e directory
by issuing this command:
% cd ~/usr/local/swish-e
Create a SWISH-E configuration file (swish.conf)
for your Virtual Server. Save this file under the name of
website.conf (or some other name of your liking) and then
store this file in the ~/usr/local/swish-e directory. You
will find a default configuration file called ~/usr/local/swish-e/swish.conf
which you can use as a template (just
make sure you change all occurrences of
LOGIN_NAME to match
the login name of your Virtual Server).
You should be very familiar with the
section of the configuration file. By default, SWISH-E
will not index files in directories containing a .htaccess file. If
you have a directory that contains a .htaccess file, and would like
it indexed, then comment out that
line by placing a "
#" as the first character in the line.
Create a separate configuration file for each search on your Virtual Server. For
example, if you have several users on your server that require separate
searches for their own directories, create a separate configuration file
for each user. Then use the configuration files to create separate
index files for each search.
Run SWISH-E, like this:
% cd ~/usr/local/swish-e
% ./swish-e -c CONFIG_FILE
CONFIG_FILE is the name of your SWISH-E configuration file
you created in the previous step.
After you run the SWISH-E executable, a SWISH-E index
file will be generated. The name of the SWISH-E index file
is that which you specified as the value for the
IndexFile variable in the SWISH-E configuration file.
The Search Form
To install the search on your web site you will need to
download the Search Form
and store it somewhere in your
usr/local/etc/httpd/htdocs directory structure. Feel free to customize
the form, add graphics, etc. But be sure that the variable name
for each input field is not altered.
The form can be
customized for your Virtual Server by simply changing the occurrence
SWISH_INDEX_FILE to the name of the swish-e
index which you specified as the value for the
in the SWISH-E configuration file.
You may hide the
maxresults field by simply using a
type=hidden argument with the
The Search CGI
You can customize the appearance of the search CGI, if you wish.
Two subroutines in the ~/www/cgi-bin/library/searchindex/util.pl
are used to print out header and footer information.
Feel free to modify these functions
such that the CGI outputs pages that are in synch with the motifs
of the rest of your site.
For more information and documentation see: