Skip to main content.
home | support | download

Back to List Archive

Re: swish-e filters

From: Bill Moseley <moseley(at)not-real.hank.org>
Date: Tue Apr 16 2002 - 14:49:59 GMT
At 01:54 AM 04/16/02 -0700, Urtzi Larrazabal wrote:
>I would very very gratefull if you could help me please.
>I am trying to execute swish with a filter and I don't know why but it
doesn't work well.
>
># vi user.config
>
>FilterDir /usr/local/swish/filters/
>
>#FileFilter .gz gzip-filter.sh
>#FileFilter .pdf pdf-filter.sh
>FileFilter .pdf sample.sh

The examples in the 2.1-dev documentation avoid the shell (and especially
perl) by calling the programs directly:

    FileFilter .pdf   pdftotext   "'%p' -"
    FileFilter .gz    gzip  "-c '%p'"

Try it that way.

># more sample.sh
>#!/bin/sh
>echo "File to convert: $1"
>echo "URL or Filename: $2"
>echo "If arg 2 is not empty this"
>echo " this is the  filename or url"
>echo " (means: $1 = temp. file)"

The above works for me:

> ./swish-e -c c -i 1.html -T indexed_words -v0
Indexing Data Source: "File-System"
    Adding:[1:swishdefault(1)]   'file'   Pos:1  Stuct:0x1 ( FILE )
    Adding:[1:swishdefault(1)]   'to'   Pos:2  Stuct:0x1 ( FILE )
    Adding:[1:swishdefault(1)]   'convert'   Pos:3  Stuct:0x1 ( FILE )
    Adding:[1:swishdefault(1)]   '1'   Pos:4  Stuct:0x1 ( FILE )
    Adding:[1:swishdefault(1)]   'html'   Pos:5  Stuct:0x1 ( FILE )
    Adding:[1:swishdefault(1)]   'url'   Pos:6  Stuct:0x1 ( FILE )
    Adding:[1:swishdefault(1)]   'or'   Pos:7  Stuct:0x1 ( FILE )
    Adding:[1:swishdefault(1)]   'filename'   Pos:8  Stuct:0x1 ( FILE )
    Adding:[1:swishdefault(1)]   '1'   Pos:9  Stuct:0x1 ( FILE )
    Adding:[1:swishdefault(1)]   'html'   Pos:10  Stuct:0x1 ( FILE )
    Adding:[1:swishdefault(1)]   'if'   Pos:11  Stuct:0x1 ( FILE )
    Adding:[1:swishdefault(1)]   'arg'   Pos:12  Stuct:0x1 ( FILE )
    Adding:[1:swishdefault(1)]   '2'   Pos:13  Stuct:0x1 ( FILE )
    Adding:[1:swishdefault(1)]   'is'   Pos:14  Stuct:0x1 ( FILE )
    Adding:[1:swishdefault(1)]   'not'   Pos:15  Stuct:0x1 ( FILE )
    Adding:[1:swishdefault(1)]   'empty'   Pos:16  Stuct:0x1 ( FILE )
    Adding:[1:swishdefault(1)]   'this'   Pos:17  Stuct:0x1 ( FILE )
    Adding:[1:swishdefault(1)]   'this'   Pos:18  Stuct:0x1 ( FILE )
    Adding:[1:swishdefault(1)]   'is'   Pos:19  Stuct:0x1 ( FILE )
    Adding:[1:swishdefault(1)]   'the'   Pos:20  Stuct:0x1 ( FILE )
    Adding:[1:swishdefault(1)]   'filename'   Pos:21  Stuct:0x1 ( FILE )
    Adding:[1:swishdefault(1)]   'or'   Pos:22  Stuct:0x1 ( FILE )
    Adding:[1:swishdefault(1)]   'url'   Pos:23  Stuct:0x1 ( FILE )
    Adding:[1:swishdefault(1)]   'means'   Pos:24  Stuct:0x1 ( FILE )
    Adding:[1:swishdefault(1)]   '1'   Pos:25  Stuct:0x1 ( FILE )
    Adding:[1:swishdefault(1)]   'html'   Pos:26  Stuct:0x1 ( FILE )
    Adding:[1:swishdefault(1)]   'temp'   Pos:27  Stuct:0x1 ( FILE )
    Adding:[1:swishdefault(1)]   'file'   Pos:28  Stuct:0x1 ( FILE )




-- 
Bill Moseley
mailto:moseley@hank.org
Received on Tue Apr 16 14:50:05 2002