Swishing revisited

Here's some code to make the search form on your aether blog use the powerful full-text indexer swish-e. Search results include the page title, location, and excerpts with the search terms in bold, as in the following example:

Another constant-current circuit [projects/01111254927]
Here's a constant-current LED driver circuit meant for use with wall-wart power supplies The general idea...
... but you could mix different LED types in one strand (for instance, 2 strands each with...

Put 'from search import *' in your _code.py, and put swish_config in the same directory, renamed "_swish_config".

The _swish_config file is supposed to exclude "secret" files like _code.py from the search. The path to aetherfilter also needs to be set in this file.

Compile aetherfilter.c and place the resulting binary somewhere convenient. Run a periodic cron job to regenerate the database, along the lines of

    */20 * * * * cd /var/www/html/aether/index.cgi-data; swish-e -c _swish_config -i .

Files currently attached to this page:

swish_config215 bytes

Entry first conceived on 4 June 2005, 21:26 UTC, last modified on 15 January 2012, 3:46 UTC
Website Copyright © 2004-2024 Jeff Epler