Skip to main content.
home | support | download

Back to List Archive

RE: how to get a description

From: Wolf, Dena <dena.wolf(at)>
Date: Mon Nov 25 2002 - 16:42:32 GMT
Hi there Mr Moseley, Grunstein et al
I appreciate your email.  I can't find the debugging you reference.  I also
do not know where to find perldoc swish.cgi.

I am on a shared solaris server.  I do not know if libxml2 is installed.  I
did not install it, but swish came with our account, and I do not know if
they installed it. I don't see it.  All this came about because I am trying
to customize the swish that our isp gave us.  I moved the swish.cgi into my
cgi bin and created a config file.  All went well, and the indexing works.
The problem is I can't get it to show descriptions.  No matter what I do, I
get the 2 BAD DIRECTIVE lines for the lines in my config file that begin
IndexContents & StoreDescription.  Without these two lines in the config
file, the indexing works fine. But I want to show descriptions.

Here is my config file:

IndexFile index.swish
#MetaNames keywords description
IndexReport 3
FollowSymLinks no
IgnoreTotalWordCountWhenRanking yes
ReplaceRules replace "/export/home/orcsolar/" ""
ReplaceRules remove "html/"
IgnoreLimit 50 1000
FileRules pathname contains members
NoContents .gif .xbm .au .mov .mpg .ps
IndexComments yes
IndexContents HTML* .html
StoreDescription HTML* <body> 100000

When I index, I run:
cgi-bin/swish-e -c cgi-bin/orcsolar.config -i html -f html/index.swish

When I run it I get:
Indexing Data Source: "File-System"
Bad directive on line #14: IndexContents HTML* .html
Bad directive on line #15: StoreDescription HTML* <body> 100000

I don't know what running the cgi script will do for me since it is working
fine before I put in these two lines.  I am wondering if something else in
my config file is wrecking these lines for me, or if they don't work with
the fs method or what the heck is going on?  I am sorry I have trouble
following your recommendations below on what to do.

Thanks very much for any further consideration,

-----Original Message-----
From: Bill Moseley []
Sent: Tuesday, November 19, 2002 3:38 PM
To: Multiple recipients of list
Subject: [SWISH-E] RE: how to get a description

At 12:04 PM 11/19/02 -0800, Wolf, Dena wrote:
>I am doing this on the web, so I need my indexing to store the

Yes, if you want to show descriptions that's the easiest way to do it.

>Users will just be searching for words on the website, and I want a
>summary or excerpt to appear below the links to the documents that contain
>the words they are looking for. Does this make sense.

Yes, that's the point of the StoreDescription directive.

>They will not be
>entering any switches when they search on the web.  I put in the HTML2
>& still get bad directive for those 3 lines.

That may be because you did not build swish-e with libxml2.  I think I
asked before, but what platform are you running on?  When you ran
./configure it would have said if libxml2 was linked in or not (not that
most people would notice that kind of stuff).

If libxml2 was not build with swish-e then you cannot use HTML2, so replace
it with HTML or HTML* (which says use libxml2 if available otherwise use
the internal HTML parser).

My advice again is to use perldoc swish.cgi and step through the
step-by-step instructions or the debugging section.  That will take more
time.  But like anything breaking things down into parts will make life

1) index a few HTML docs.
2) run queries from the command line

       ./swish-e -w foo -m1 -x '<swishdocpath> <swishdescription>\n'

or even 

       ./swish-e -m1 -T index_files

This will show that the description is indeed being stored.

3) then configure the swish.cgi script and *run it from the command line*
perldoc swish.cgi has debugging examples that show how to do that.

4) run from the web.

>I have been going at this for
>4 days now :(

I know how you feel.  I've been going at it for hundreds of days!

Bill Moseley
Received on Mon Nov 25 16:42:49 2002