Skip to main content.
home | support | download

Back to List Archive

Re: [swish-e] Swish 2.4.5 working, SWISH::API seems to be working but isn't

From: Bernard T. Higonnet <bth(at)>
Date: Fri Feb 23 2007 - 23:36:14 GMT
When I started this thread, my problem was that my $hits = $results->Hits; was 
returning -4629728351404162355 hits which was clearly wrong.

Instead of trying to figure out why this wasn't working using mod_perl, I 
chose to pursue using swish from the command line (where it was working) to 
familiarize myself with swish. I finally got swish to report the results of a 
very simple search.

Having done this, I told myself I would now try to get it working using 
mod_perl, so I ran it under that. It turns out that swish/SWISH::API is 
working under mod_perl. The $hits = $results->Hits; is still wrong, but the 
actual search results are fine!

There is one other very curious difference between running under mod_perl and 
at the command line. I use the the following little subroutine to check for 
and report errors (first parameter is swish object, second is a different 
identifier for each call):

sub chkerrors ($$) {
if (!$_[0]->Error) {print "$_[1] returned OK";return;}
my $badmsg = $_[0]->error_string;
print "$_[1]-$badmsg";
$badmsg = $_[0]->last_error_msg;
print "$_[1]2-$badmsg";

Even when there are no errors (i.e. the command line version executes without 
errors and the mod_perl version gives the same search results) the if test 
always concludes there is one.

When there really is an error (e.g. I give a non existent index file name to 
new()), then the swish error is correctly reported.

Bernard Higonnet
FreeBSD 6.1-RELEASE #0
Apache/2.2.3 (Unix) DAV/2 PHP/5.2.0 mod_perl/2.0.3 Perl/v5.8.8
Users mailing list
Received on Fri Feb 23 18:33:48 2007