Skip to main content.
home | support | download

Back to List Archive

Re: Perl API and mod_perl/Incremental

From: Bill Moseley <moseley(at)>
Date: Thu Feb 17 2005 - 20:49:22 GMT
On Thu, Feb 17, 2005 at 12:21:35PM -0800, Mark Maunder wrote:
> Definitely use SWISH::API, you'll notice a big speed increase. Beware of
> caching the SWISH::API object and refreshing indices. It seems that
> swish caches the old index and I get old results even though the old
> index file is gone and replaced by a new one.

It's not caching it.  The index stays around (even after being
deleted/replaced by a new index) because swish still has the index
files open.  It's that old log rotation issue.

> What I should be doing is
> a stat() on the index file every time before I do a query to check if
> it's more recent than when I created the swish object, and reloading it
> if it is. Instead I'm lazy and just create a new swish object every time
> I do a query. And it's still very fast.

I think you would seem a good speed increase if you kept the index
open.  I guess you want to stat and look for an inode change.  To do
it right I think SWISH::API (really swish) needs to be able to pass
you the file handle so you can stat it and compare it with a stat of
the index file name.  Want to be careful to not have search results
still in memory when reopening the index -- file numbers could end up
pointing to the wrong place.

I'm not sure how an incremental index would work differently.  Some
of the index files are recreated and some are just updated.  Probably
need to reopen everything.

Bill Moseley

Unsubscribe from or help with the swish-e list:

Help with Swish-e:
Received on Thu Feb 17 12:49:27 2005