Skip to main content.
home | support | download

SWISH-RUN - Running Swish-e and Command Line Switches

Swish-e version 2.4.5

Table of Contents


OVERVIEW

The Swish-e program is controlled by command line arguments (called switches). Often, it is run manually from a shell (command prompt), or from a program such as a CGI script that passes the command line arguments to swish.

Note: A number of the command line switches may be specified in the Swish-e configuration file specified with the -c command line argument. Please see SWISH-CONFIG for a complete description of available configuration file directives.

There are two basic operating modes of Swish-e: indexing and searching. There are command line arguments that are unique to each mode, and others that apply to both (yet may have different meaning depending on the operating mode). These command line arguments are listed below, grouped by:

INDEXING -- describes the command line arguments used while indexing.

SEARCHING -- lists the command line arguments used while searching.

OTHER SWITCHES -- lists switches that don't apply to searching or indexing.

Beginning with Swish-e version 2.1, you may embed its search engine into your applications. Please see SWISH-LIBRARY.

INDEXING

Swish-e indexing is initiated by passing command line arguments to swish. The command line arguments used for searching are described in SEARCHING. Also, see SWISH-SEARCH for examples of searching with Swish-e.

Swish-e usage:

    swish-e [-i dir file ... ] [-c file] [-f file] [-l] \
            [-v (num)] [-S method(fs|http|prog)] [-N path]

The -h switch (help) will list the available Swish-e command line arguments:

    swish-e -h

Typically, most if not all indexing settings are placed in a configuration file (specified with the -c switch). Once the configuration file is setup indexing is initiated as:

    swish-e -c /path/to/config/file

See SWISH-CONFIG for information on the configuration file.

Security Note: If the swish binary is named swish-search then swish will not allow any operation that would cause swish to write to the index file.

When indexing it may be advisable to index to a temporary file, and then after indexing has successfully completed rename the file to the final location. This is especially important when replacing an index that is currently in use.

    swish-e -c swish.config -f index.tmp
    [check return code from swish or look for err: output]
    mv index.tmp index.swish-e

Indexing Command Line Arguments

SEARCHING

The following command line arguments are available when searching with Swish-e. These switches are used to select the index to search, what fields to search, and how and what to print as results.

This section just lists the available command line arguments and their usage. Please see SWISH-SEARCH for detailed searching instructions.

Warning: If using Swish-e via a CGI interface, please see CGI Danger!

Security Note: If the swish binary is named swish-search then swish will not allow any operation that would cause swish to write to the index file.

Searching Command Line Arguments

OTHER SWITCHES

Merging Index Files

In previous versions of Swish-e indexing would require a very large amount of memory and the indexing process could be very slow. Merging provided a way to index in chunks and then combine the indexes together into a single index.

Indexing is much faster now and uses much less memory, and with the -e switch very little memory is needed to index a large site.

Still, at times it can be useful to merge different index files into one file for searching. This could be because you want to keep separate site indexes and a common one for a global search, or you have separate collections of documents that you wish to search all at one time, but manage separately.

Document Info

$Id: SWISH-RUN.pod,v 1.40 2005/05/17 02:22:40 karman Exp $

.