Skip to main content.
home | support | download

Back to List Archive

search.cgi updates

From: Bill Moseley <moseley(at)>
Date: Tue Jun 01 2004 - 18:30:38 GMT
Here's another "I wonder what the list would say?" posts:

After Greg's email I'm about to test out search.cgi running under
mod_perl.  I have some design questions I wanted to ask about

First, I wrote search.cgi as a simple alternative to swish.cgi --
something with fewer features but better for customizing (since it's
really just a simple skeleton of a script).  It uses SWISH::API and
Template-Toolkit in a somewhat MVC style of coding.

I included the output template right in the script to make it all
inclusive, but most people would normally place the template in a
separate file and then provide headers/footers/wrappers to make the
search results page fit into their site's design (especially if the site
was already maintained by Template-Toolkit).

So, I'm wondering if the script is too simple, or if it's good the way
it currently is:

1) Should I pull out the template from the __DATA__ section and place
the template in a separate file -- or possibly a few template files so a
site's layout/design can be more easily included?  If the script runs
under SpeedyCGI or mod_perl then the template needs be in a separate

2) The script doesn't include many features like being able to limit
searches by meta names or select sort order.  Are those features common
enough that they should be included?  I don't want it to be a drop-in
replacement for swish.cgi -- it's suppose to be just a skeleton used as
a starting point for programmers -- but I can see providing a few extra
features might be nice.

I did modify the script for someone the other day that allowed limiting
by metaname and better highlighting support.  Hypermail kind of hacked it
up, but it's at:

Should those changes be included?  Namely better highlight support
and metaname selection?

3) swish.cgi has two example templates (for use with HTML::Template and
Template-Toolkit).  One is named swish.tmpl (for HTML::Template) but the
other is named (for Template-Toolkit).  That's unfortunate
naming since it would seem like would work with search.cgi,
which it doesn't.

So, see any reason why shouldn't be renamed to  It
could cause some grief for anyone using in the default install
location, especially if was used for #1 above.  But, I wonder
if it won't cause more confusion for those trying to use search.cgi when
first starting out.

Bill Moseley
Received on Tue Jun 1 11:30:39 2004