Skip to main content.
home | support | download

Back to List Archive

Re: swish.cgi is not returning results

From: Bill Moseley <moseley(at)>
Date: Fri Oct 04 2002 - 21:04:29 GMT
At 11:14 AM 10/04/02 -0700, Peggy Eaton wrote:
>I'm attempting to use the swish.cgi script that comes with the 
>swish-e-2.2.1 distribution, and searches are not working.  I get a 
>message in the results page: "Failed to find end of results".  I've 
>included all the information on various pieces of the puzzle below. 
>Sorry its so long.

I'm make a few comments (surprise!) and give debugging examples.

>IndexContents HTML2 .shtml .html .htm
>DefaultContents HTML2
>IndexOnly .html .shtml

Is .shtml a server generated page?  

>NoContents .doc .gif .js .pdf .php .txt .xml

Anything not .shtml or .html won't be indexed, so that line doesn't do

>StoreDescription HTML <body> 200
>StoreDescription XML <body> 200
>StoreDescription HTML2 <body> 200
>StoreDescription XML2 <body> 200

Only need one of those in this case, but I assume you understand that.

>PropertyNameAlias swishdescription body

Remove that line.  StoreDescription already does that.

>Below are the sections of code in swish.cgi that I customized:

>     # This one is obvious, I hope:
>     $Swish_Binary = '/usr/daac/dev/bin/Swish-e';

You are using scalar variables for settings.  That must be an old version
of the script -- as the settings were changed to a hash over a year ago
(July 1, 2001).

In the current swish.cgi script the parameters are in a (an anonymous) hash:

    return = {
       Swish_Binary => '/usr/daac/dev/bin/Swish-e',
       Swish_Index  => '/usr/daac/doc/internal/web/swish_search.index',
So perhaps that's the problem?

>     $Metaname_Default = 'description';  # set the default radio button
>     $All_Meta = 0;

Here's my test using the current version of the swish.cgi script.

swish > cat c
IndexContents HTML2 .shtml .html .htm
IndexOnly .html .shtml
#ParserWarnLevel 2
StoreDescription HTML2 <body> 200

swish > ./swish-e -c c -i /usr/local/apache/htdocs | grep indexed
7531 unique words indexed.
192 files indexed.  2531620 total bytes.  243844 total words.

Here's the config file for the CGI script:

swish > cat .swishcgi.conf
return {
     Swish_Binary     => './swish-e',
     Swish_Index      => 'index.swish-e',

See if the script runs:

swish > ./swish.cgi | wc -l

Now, if it doesn't work at this point there debugging options.  I'm sending
output of the script to /dev/null for now.

swish > SWISH_DEBUG=help ./swish.cgi >/dev/null
Unknown debug option 'help'.  Must be one of:
       basic: Basic debugging
     command: Show command used to run swish
     headers: Show headers returned from swish
      output: Show output from swish
     summary: Show summary of results
        dump: Show all data available to templates

So for example:

swish > SWISH_DEBUG=basic ./swish.cgi >/dev/null
Debug level set to: 1

---------- Read config parameters from '.swishcgi.conf' ------
$VAR1 = {
          'Swish_Index' => 'index.swish-e',
          'Swish_Binary' => './swish-e'
Debug level set to: 1
Enter a query [all]: apache
Enter max results to display [1]: 
Found 1 results

Or to look at the output from swish:

swish > SWISH_DEBUG=output ./swish.cgi >/dev/null       
Debug level set to: 9

---------- Read config parameters from '.swishcgi.conf' ------
$VAR1 = {
          'Swish_Index' => 'index.swish-e',
          'Swish_Binary' => './swish-e'
Debug level set to: 9
Enter a query [all]: apache
Enter max results to display [1]: 
# IgnoreFirstChar: 
# IgnoreLastChar: 
# StopWords:
# BuzzWords:
# Removed stopwords: 
1       Using Apache with Microsoft Windows     Apache HTTP Server Version
1.3 Using Apache With Microsoft Windows This document explains how to
install, configure and run Apache 1.3 under Microsoft Windows. Please note
that at this time, Windows s    2000-02-23 15:11:39 PST 21664
/usr/local/apache/htdocs/manual/windows.html  1000
Found 1 results

I hope that's enough to get you going.

Bill Moseley
Received on Fri Oct 4 21:08:34 2002