Skip to main content.
home | support | download

SWISH-CONFIG - Configuration File Directives

Swish-e version 2.4.7

Table of Contents


OVERVIEW

This document lists the available configuration directives available in Swish-e.

CONFIGURATION FILE

What files Swish-e indexes and how they are indexed, and where the index is written can be controlled by a configuration file.

The configuration file is a text file composed of comments, blank lines, and configuration directives. The order of the directives is not important. Some directives may be used more than once in the configuration file, while others can only be used once (e.g. additional directives will overwrite preceding directives). Case of the directive is not important -- you may use upper, lower, or mixed case.

Comments are any line that begin with a "#".

    # This is a comment

As of 2.4.3 lines may be continued by placing a backslas as the last character on the line:

    IgnoreWords \
        am \
        the \
        foo

Directives may take more than one parameter. Enclose single parameters that include whitespace in quotes (single or double). Inside of quotes the backslash escapes the next character.

    ReplaceRules append "foo bar"   <- define "foo bar" as a single parameter

If you need to include a quote character in the value either use a backslash to escape it, or enclose it in quotes of the other type.

Backslashes also have special meaning in regular expressions.

    FileFilterMatch pdftotext "'%p' -" /\.pdf$/

This says that the dot is a real dot (instead of matching any character). If you place the regular expression in quotes then you must use double-backslashes.

    FileFilterMatch pdftotext "'%p' -" "/\\.pdf$/"

Swish-e will convert the double backslash into a single backslash before passing the parameter to the regular expression compiler.

Commented example configuration files are included in the conf directory of the Swish-e distribution.

Some command line arguments can override directives specified in the configuration file. Please see also the SWISH-RUN for instructions on running Swish-e, and the SWISH-SEARCH page for information and examples on how to search your index.

The configuration file is specified to Swish-e by the -c switch. For example,

    swish-e -c myconfig.conf

You may also split your directives up into different configuration files. This allows you to have a master configuration file used for many different indexes, and smaller configuration files for each separate index. You can specify the different configuration files when running from the command line with the -c switch (see SWISH-RUN), or you may include other Configuration file with the IncludeConfigFile directive below.

Typically, in a configuration file the directives are grouped together in some logical order -- that is, directives that control the source of the documents would be grouped together first, and directives that control how each document is filtered or its words index in another group of directives. (The directives listed below are grouped in this order).

The configuration file directives are listed below in these groups:

Alphabetical Listing of Directives

Directives that Control Swish

These configuration directives control the general behavior of Swish-e.

  • IncludeConfigFile *path to config file*

    This directive can be used to include configuration directives located in another file.

        IncludeConfigFile /usr/local/swish/conf/site_config.config
  • IndexReport [0|1|2|3]

    This is how detailed you want reporting while indexing. You can specify numbers 0 to 3. 0 is totally silent, 3 is the most verbose. The default is 1.

    This may be overridden from the command line via the -v switch (see SWISH-RUN).

  • ParserWarnLevel [0|1|2|3]

    Sets the error level when using the libxml2 parser for XML and HTML. libxml2 will point out structural errors in your documents.

        0 = no report
        1 = fatal errors
        2 = errors
        3 = warnings

    Currently (as of 2.4.4 - early 2005) libxml2 only reports errors at level 2. The default as of 2.4.4 is "2" which should report any errors that might indicate a problem parsing a document.

    The exception to this is UTF-8 to Latin-1 conversion errors are reported at level 3 (changed from 1 in 2.4.4). Although these errors indicate a problem indexing text, they are only reported at level 3 because they can be very common.

    It is recommended that you index at ParserWarnLevel 3 when first starting out to see what errors and warnings are reported. Then reduce the level when you understand what documents are causing parsing problems and why.

  • IndexFile *path*

    Index file specifies the location of the generated index file. If not specified, Swish-e will create the file index.swish-e in the current directory.

        IndexFile /usr/local/swish/site.index
  • obeyRobotsNoIndex [yes|NO]

    When enabled, Swish-e will not index any HTML file that contains:

        <meta name="robots" content="noindex">

    The default is to ignore these meta tags and index the document. This tag is described at http://www.robotstxt.org/wc/exclusion.html.

    Note: This feature is only available with the libxml2 HTML parser.

    Also, if you are using the libxml2 parser (HTML2 and XML2) then you can use the following comments in your documents to prevent indexing:

           <!-- SwishCommand noindex -->
           <!-- SwishCommand index -->

    and/or these may be used also:

           <!-- noindex -->
           <!-- index -->

    For example, these are very helpful to prevent indexing of common headers, footers, and menus.

NOTE: This following items are currently not available. These items require Swish-e to parse the configuration file while searching.

iv> ex.html" "-" as H þÿ not tl" /> ri, $server, $responame="remdocument_info">Document Ises the environment variabi> arinfiguration directives (e.g., tion filter_content => $filtegt;nexl>

Fetches the next result from the list of results. Returns undef if no more results are available. $result is an object blessed into the SWISH::API::Result class.

  • Fixed minor memory leak

    Fixed leak of not releasing memory of index file name and swish_handle destroy, and fixed Sremove_leading_dots

    Removes leading dots from Access method.

  • *nu being stema GET re *nu being ste

  • /co