SWISH 1.2.1

User Guide

[Index] [Previous Chapter] [Next Chapter]

Most users will probably never access swish directly; they will probably use a web interface, such as w4ais. But somebody has to test swish and configure it to work the way people expect it to work locally, with whatever interface is used. This document is primarily for such people.

Searching with SWISH

In the SWISH distribution, there's a sample SWISH index (called sample.swish). If you have the source tree available, you can do a simple search on it; otherwise, try the commands below on your index, but substituting words you expect to find indexed at your site.
  swish -f Test/sample.swish -w swish and relevance
This will search the file sample.swish for files consisting of the words swish and relevance.

NOTE: All swish searches are case-insensitive.

You should get something back like this:

# SWISH format 1.1
search words: swish and relevance
# Name: Samples swish search
# Saved as: sample.swish
# Counts: 957 words, 5 files
# Indexed on: 02/08/98 21:26:30 CDT
# Description: If it's in here, swish can find it!
# Pointer: http://www.rru.com/
# Maintained by: Suzi Styrofoam (suzi@rru.com)
1000 Docs/swish.text "swish.text" 31656
131 Docs/swish.html "SWISH Documentation" 34383

The results tell you:

  1. The format the results are in (so future versions of swish or other searching programs know this),

  2. The search words you used,

  3. Administrative information about the index (so you know who maintains it and where to find the original),

  4. A result line - this is made up of:

    • The relevance rank. This number is generated with each result and is the program's "best guess" as to how relevant it thinks the file is to your query. This rank number, which can range from 1 to 1000, depends on a number of factors, such as how many times your search word appears in the file, how many words are in the file, and if the word appears in a title or header tag (if it's an HTML file), among other factors.

    • The path name to the file. This may be an address, such as a URL, or a full path to the file.

    • The title of the file. If this is an HTML file, this is the title. This may also be the name of the file (if there is no title).

    • The size of the file. This size is always in bytes.

  5. A period. This signifies the end of the results. A line with a period always signifies the end of swish output.

If there are errors, instead of the results list, you may get one of the following error lines. These lines will always be prefixed with err:.

Likely command line options

Other variants you are likely to use for searching include:
  swish -c some_path/swish.conf -w swish and relevance
In this case, everything is defined in the config file, including the path to the index itself.
  swish -c some_path/swish.conf -f other_path/index.swish \
    -w swish and relevance
In this case, the index file is either not included in the config file, or you wish to override it. This is especially useful for situations like multiple users with their own indexes, but a sitewide configuration file for consistency, or because the users aren't technically inclined, or simply don't need to worry about it.

Indexing with SWISH

To index a site using the options in a configuration file, type:
  swish -c /usr/local/httpd/conf/swish/swish.conf -v 1

This assumes that everything, including the files to index, and the location of the index, are defined in /usr/local/httpd/swish/swish.conf . If this is not the case, the above invocation will probably fail.

The -v option isn't necessary - it just gives you a summary of what happened after the indexing operation is through. The first couple of times you index a given directory or set of files, you may wish to set the verbosity to 2 or 3 to see details of what's being indexed. This may show you some directories or files you can remove from the indexing process via the Configuration Guide.

For a common configuration file and multiple indexes, you might do something like this:

  swish -c /usr/local/httpd/conf/swish/swish.conf \
    -i /Users/edo/public_html -f /Users/edo/public_html/index.swish
  swish -c /usr/local/httpd/conf/swish/swish.conf \
    -i /Users/jbo/public_html -f /Users/jbo/public_html/index.swish
This would index the public_html directories for two different users (edo and jbo), giving them each an index file (index.swish) of their personal web pages. This can also be done in a script for all users:
  for u in /Users/*/public_html ; do
    swish -c /usr/local/httpd/conf/swish/swish.conf -i $u -f $u/index.swish

[Index] [Previous Chapter] [Next Chapter]

Last update: 18/Aug/1998