Skip to main content.
home | support | download

Back to List Archive

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

From: Bernard T. Higonnet <bth(at)not-real.higonnet.net>
Date: Sat Feb 17 2007 - 22:39:35 GMT
Hello,

I seem to have installed everything so it's working. I have indexed a web site 
and when I search it using swish-e on the command line it gets the right 
results.

When I try to use SWISH::API so that a browser can search my web site, I don't 
get very far.

SWISH::API seems to be working. What that means is that it does simple things 
without complaining, has been known to write error messages (e.g. when it 
couldn't find the index file on the first try). Here is the code I am using

========================================
my $myindex="/tmp/index.swish-e";
my $swish = SWISH::API->new($myindex);
print header(), start_html();
my $badmsg = $swish->error_string;
print "hoo $badmsg<br>";
$badmsg = $swish->last_error_msg;
print "haa $badmsg<br>";
my $search = $swish->new_search_object;
my $results = $search->execute( "Bonnieux" );
if ($swish->Error) {$badmsg = $swish->error_string;print "queryhoo 
$badmsg<br>";
    $badmsg = $swish->last_error_msg;print "queryhaa $badmsg<br>";}
my $hits = $results->hits;
print "Found ", $results->hits, " hits<br>";


The code above yields this:

hoo
haa
queryhoo
queryhaa
Found -4629728351404162355 hits
===================================================


This particular search string "Bonnieux" generates hundreds of hits on the 
command line. 



This is perplexing!

I'm sure I'm doing something simple that's wrong...

TIA
Bernard Higonnet
Software used:
FreeBSD 6.1-RELEASE #0: Sun May  7 04:32:43 UTC 2006     
root@opus.cse.buffalo.edu:/usr/obj/usr/src/sys/GENERIC  i386
Apache/2.2.3 (Unix) DAV/2 PHP/5.2.0 mod_perl/2.0.3 Perl/v5.8.8
_______________________________________________
Users mailing list
Users@lists.swish-e.org
http://lists.swish-e.org/listinfo/users
Received on Sat Feb 17 17:37:49 2007