A Simple Website Search Facility

Did you intend to search OUR site?

A Simple Website Search Program

Just 224 Lines of Perl 5!

Permission is given to use and modify these scripts as you see fit, as long as you acknowledge the source and link to this page.

We have made the scripts that are used to search our web server freely available. The scripts are written in Perl 5. search.cgi must be installed as a CGI program in order to work, and search-index must be run on a regular basis in order for search.cgi to produce useful results. Perl 5 must be available on your web server and you must know how to install CGI programs on it or get the help of someone who does. CGI.pm must also be installed, which is usually the case. It doesn't matter what you have on your own computer.

This search script does not use a fancy indexing system, so it is not as fast or efficient as the big commercial search engines. However, it does use a simple but clever indexing approach that considerably reduces the amount of work to be done by the program on each search. If you have a very large site with many users searching constantly, you might not want to use it. If, on the other hand, your users search only occasionally (like ours), you'll find it very useful.

We cannot tell you how to install CGI programs on your web server. If you get server errors, read YOUR server's DOCUMENTATION. Don't send us email about it. Thanks!

After you download the source code, you need to edit it to suit your site. Mandatory settings are at the top.

Download the search.cgi Source Code

Download the search-index Source Code

Download problems? Code doesn't seem to work? Make sure you use the "Save Link As" option in your browser to save the file without modifying it, inserting unwanted line breaks, and so on. Change the filenames as appropriate. EDIT THE SETTINGS AT THE TOP OF search.cgi. Run search-index on a regular basis, preferably from cron or another automation facility. For a list of arguments, run search-index without specifying any arguments.
Boutell.Com, Inc.