Skip to main content.
home | support | download

Back to List Archive

Re: [Ignor Postmaster] switching from swish.cgi to search.cgi

From: <Deepesh_Banerji(at)>
Date: Thu May 20 2004 - 15:07:37 GMT
Thanks for the quick response Bill, 2 more questions for you:

Question 1 - You mentioned that swish.cgi's template and search.cgi's
template get passed very different data. (search.cgi gets raw data
objects). Is there a way that I can easily make search.cgi pass to the
swish.cgi template the correct type of data objects? Or is it more feasible
to start from scratch on the search.cgi template.

Question 2 - If I enable "use_library => 1" in the swish.cgi script, what
does this do exactly? Does this mean I have to replace all the build
query-type statements present in the swish.cgi file with the Swish:API
statements? If you could give me some more info on the effects of enabling
use_library that would be great.

Thanks so much for all your help so far,


|         |           Bill Moseley     |
|         |           <|
|         |           >                |
|         |           Sent by:         |
|         |           swish-e@sunsite.b|
|         |       |
|         |                            |
|         |                            |
|         |           05/20/2004 10:48 |
|         |           AM               |
|         |           Please respond to|
|         |           moseley          |
|         |                            |
  |                                                                                                              |
  |       To:       Multiple recipients of list <>                                   |
  |       cc:                                                                                                    |
  |       Subject:  [SWISH-E] Re: [Ignor Postmaster] switching from swish.cgi to search.cgi                      |
  |                                                                                                              |
  |                                                                                                              |

On Thu, May 20, 2004 at 10:05:42AM -0400, wrote:
> Good day,

Good day to you!

I'm cc'ing the swish-e list as that's where swish-e questions should go.

> So I'm trying to switch my search form file from swish.cgi (the big file
> that builds a swish-e.exe query and runs it each time) to the search.cgi
> file (the Perl API thats much faster and smaller). I'm using Apache 1.3
> Swish 2.4.2.

The swish.cgi script can use SWISH::API, too.  I think you just need to
set the "use_library => 1," option.

The difference between swish.cgi and search.cgi is that search.cgi
doesn't have all the extra, confusing, messy code to work with different
templating systems and use a config file to control its behavior.  It is
smaller, but I'm not so sure it would be much faster.

> HOWEVER, I'd like to keep using the same template that I was using before
> (ie the template I was using for swish.cgi). I'm aware that the swish.cgi
> template uses TemplateToolkit ( to build the HTML
> page, where as search.cgi (the new, quicker Perl API file) uses
> HTML::Template ( to build its HTML file.

No, search.cgi uses Template-Toolkit. is Template-Toolkit.

But, the templates are not compatible between the two.  Swish.cgi
template, in order to work in a general way with the other template
systems, gets passed very different data from the search.cgi template.
The search.cgi template just gets passed the raw data objects returned
from the SWISH::API query (for the most part).

> So my question is, to make search.cgi work with TemplateToolkit, am I
> to have to assign values to all the missing variables that search.cgi
> not populate?

I'm not sure.  You can't just drop in the template from swish.cgi and
use it with search.cgi.  That would kind of defeat the purpose of
search.cgi (to have the template get passed the objects returned from
the SWISH::API query).

I'll bet it will be easier to use the template listed at the bottom of
search.cgi and start fresh.

Bill Moseley
Received on Thu May 20 08:07:38 2004