Skip to main content.
home | support | download

Back to List Archive

Re: DirTree.pl question

From: Bill Moseley <moseley(at)not-real.hank.org>
Date: Fri Feb 08 2002 - 17:30:35 GMT
At 08:35 AM 02/08/02 -0800, Rich Thomas wrote:
>How does one configure swish to index a directory tree of html files?  I've
>looked at the DirTree.pl example and am having a tough time underdatnding
>the -S prog concept I guess.
>
>Where do I tell it what the top level directory is?  Since these are all
>html files I don't need the pdf format conversion so I can comment that out
>till needed.

Here's the overview of -S prog:  Instead of -i or IndexDir pointing to a
file or directory, with -S prog those point to program(s).  If more than
one program is listed it will run them one after another.  

e.g. I index one site where part of the site is static pages and I use
spider.pl, and the other is dynamically generated via MySQL database, so I use

    Indexdir ./spider.pl ./indexMySQL.pl

But often with programs you want to pass parameters.  It all depends on the
program.  spider.pl, for example, if no parameters are passed it will look
for a default config file for its parameters.  But if you want to pass
parameters to a -S prog program you use:

   SwishProgParameters

For example with spider.pl you can say

   SwishProgParameters config.pl

and the spider will then use config.pl for it's parameters.  With
DirTree.pl it expects a starting directory (or directories).

   SwishProgParameters /home/bill/html

In DirTree.pl it start off like:

find(
    {
        wanted => \&wanted,
        # no_chdir => 1,  # 5.6 feature
    },
    @ARGV,
);

@ARGV is the parameter list passed to DirTree.pl by swish (via
SwishProgParameters).

DirTree.pl is just suppose to be a template for you to build on.  If you
don't know perl, you can use another programming language.  Or a shell script.


>Would I do something like swish-e -S prog -i ./DirTree.pl  ?  And if so...
>how do I tell it what to index?

     SwishProgParameters /dir/to/index  /other/dir/to/index


-- 
Bill Moseley
mailto:moseley@hank.org
Received on Fri Feb 8 17:35:46 2002