O'Reilly logo

Perl for Web Site Management by John Callender

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 13. Running a CGI Search Tool

As a web site grows, offering full-text searching of its contents becomes increasingly important. It just isn’t possible (or desirable) to have a specific set of browseable links that will let every user find the content she is looking for.

SWISH (Simple Web Indexing System for Humans) is a freely available search tool, originally by Kevin Hughes, that has had a long history, featuring numerous incarnations. One of the current versions is SWISH-E, available from http://sunsite.berkeley.edu/SWISH-E/. This chapter demonstrates how to add keyword searching to a web site with SWISH-E and just a little bit of Perl CGI scripting.

The creation of this keyword-search capability will require a number of steps:

  1. Downloading the SWISH-E software source code and documentation.

  2. Uncompressing and expanding the downloaded SWISH-E source code and documentation.

  3. Compiling the SWISH-E source code to make an executable version of the program.

  4. Running the compiled SWISH-E program from the command line to create an index file.

  5. Creating a Perl CGI script that can run the SWISH-E program to retrieve a set of results matching a set of search terms, then formatting and returning those results to the web user.

Downloading and Compiling SWISH-E

Within a few clicks of the SWISH-E home page is a downloads section where one can obtain the latest version of the software. At the time of this writing, that was ftp://sunsite.berkeley.edu/pub/swish-e/swish-efiles.1.3.2.tar.gz ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required