Skip to main content.
home | support | download

Back to List Archive

AW: problems with phrasehighlight and output

From: Lammersdorf, Lorenz <Lorenz.Lammersdorf(at)>
Date: Mon Jan 05 2004 - 15:52:56 GMT
no. i added /usr/local/lib/swish-e/perl/SWISH for some testing in
.swishcgi.conf, but it doesn't work too.

swish.cgi looks like that:

use lib qw('');  		### This may need to be adjusted!
                        ### It should point to the location of the
                        ### associated script modules directory
my $DEFAULT_CONFIG_FILE = '/home/install/httpd/cgi-bin/.swishcgi.conf';

 highlight       => {

            # Pick highlighting module -- you must make sure the module can
be found

            # Ok speed, but doesn't handle phrases.
            #Deals with stemming, but not stopwords
            #package         => 'DefaultHighlight',

            # Somewhat slow, but deals with phases, stopwords, and stemming.
            # Takes into consideration WordCharacters, IgnoreFirstChars and
            package         => 'SWISH::PhraseHighlight',

ans .swishcgi.conf contains:

use lib '/usr/local/lib/swish-e/perl';


-----Ursprungliche Nachricht-----
Von: Bill Moseley []
Gesendet: Montag, 5. Januar 2004 16:41
An: Lammersdorf, Lorenz
Cc: Multiple recipients of list
Betreff: Re: [SWISH-E] problems with phrasehighlight and output

On Mon, Jan 05, 2004 at 03:14:55AM -0800, Lammersdorf, Lorenz wrote:
> hi all,
> i installed swish-e 2.4 and configured it just the same way, we've
> configured 2.2.3 before. but now, i get this error-message:
> /www/cgi-bin/swish.cgi: Can't locate in @INC (@INC
> contains: /usr/local/lib/swish-e/perl '/usr/local/lib/swish-e/perl/SWISH'
> /usr/local/lib/perl/5.6.1 /usr/local/share/perl/5.6.1 /usr/lib/perl5
> /usr/share/perl5 /usr/lib/perl/5.6.1 /usr/share/perl/5.6.1
> /usr/local/lib/site_perl .) at /www/cgi-bin/swish.cgi line 1455, <GEN0>
> 33
> IS in @INC:
> locate PhraseHi
> /usr/local/lib/swish-e/perl/SWISH/
> so why the heck it is not found?

1) It says:

  Can't locate in @INC

But the module is SWISH::PhraseHighlight -- not just PhraseHighlight.  
Are you using a config file and forgot to add the SWISH:: part of the 
module name?

Are you using a config file where you forgot to add the SWISH:: part?

2) The above shows:

  @INC contains: 

Looks like you are doing:

  use lib qw( '/usr/local/lib/swish-e/perl/SWISH' );

"qw" is "quote-word" and the quote characters are ( and ) -- the extra 
quotes make the path invalid.

 if i copy in
> /usr/local/lib/swish-e/perl/, swish.cgi displays "Service currently
> unavailable" and in error_log i find:
> /www/cgi-bin/swish.cgi Can't locate object method "new" via package
> "PhraseHighlight" (perhaps you forgot to load "PhraseHighlight"?) at
> /www/cgi-bin/swish.cgi line 1462, <GEN0> line 33.

That's because the module contains at the top of the file

  package SWISH::PhraseHighlight;

so you load it by file name (without the SWISH:: part) but its symbols 
are still in the SWISH::PhraseHighlight name space -- so Perl is correct 
that there is not any "new" subroutine in the "PhraseHighlight" package.

> another problem:
> swish.cgi displays as the first entry in the resultlist the whole text of
> the html-page, not an excerpt as requested. the second and following
> are displayed with the configurated limit of characters (in my case, 200
> charcaters should be displayed).

Likely because you are not using any highlighting module, and those are 
what trim the description on display.

Bill Moseley
Received on Mon Jan 5 15:53:06 2004