Searching using Swish-e

The Swish search module allows you to search index files generated by Swish-e.

Swish-e Integration

To enable any Swish searching, modify your interchange.cfg to add:

Require module Vend::Swish
AddDirective Swish hash
Variable swish Vend::Swish

To configure your catalog to use Swish, modify the appropriate catalog.cfg and add:

Swish command /usr/bin/swish-e
Swish index products/swish-e.db

Setup Searches

Finally, in search parameters, use mv_searchtype=swish or the shorthand notation st=swish.

The fields to be returned from Swish to Interchange are configurable, and default to:

mv_return_fields=code score title url mod_date filesize
mv_field_names=code score title url mod_date filesize

These correspond to:

  code      swishreccount
  score     swishrank
  url       swishdocpath
  title     swishtitle
  filesize  swishdocsize
  mod_date  swishlastmodified

The date in the mod_date field is returned in the format %Y-%m-%d %H:%M:%S.

You can change that with the date_format option:

Swish date_format "%d %b %Y"

See time glossary entry for supported format strings.

Search Examples

Simple search for the term Swish:

swish-e -w Swish

Same search with specifying the index file:

swish-e -w Swish -f db/xmldocs

You can include properties in the output:

swish-e -w Swish -f db/xmldocs -p purpose

Or search within a property:

swish-e -w purpose=LWP -f db/xmldocs

Configuration File Examples

Indexing web sites is pretty easy. Swish provides a spider script, which is simply called with the parameters default starting_URL. Create a configuration file similar to the following:

IndexFile db/icdevgroup
IndexDir /usr/local/lib/swish-e/spider.pl
SwishProgParameters default http://www.icdevgroup.org/docs/

Now you can start indexing with swish-e -S prog -c icdevgroup.conf.

DocBook! Interchange!