Skip to main content.
home | support | download

Back to List Archive

Re: [swish-e] empty indexes ...

From: Bill Moseley <moseley(at)not-real.hank.org>
Date: Sun Apr 15 2007 - 23:29:54 GMT
On Sun, Apr 15, 2007 at 01:33:01PM -0700, Jordan Hayes wrote:
> > Maybe look for them in the script before including them in the search?
> 
> I'm not much of a perl programmer, I'm afraid.
> 
> I'm just using swish.cgi ...
> 
> What would you suggest I do here:
> 
>         swish_index     => [qw( one two )],
> 
> when two might be empty ...?

Well, say you have a list of static indexes:

    @indexes = qw/ index.1 index.2 index.3 /;

I would think you could probably do something like:

    swish_index = [ grep { -f } @indexes ],

or something like that -- assuming that happens enough to catch the
changes.


> 
> Also: if the last time I built the index it wasn't empty, but this time 
> it is, the old one will stay, right?  I remember you making the change 
> that the index gets built as a .temp file and then only if it succeeds 
> does the old one get clobbered -- so that's what's happening here.  It 
> was done that way so that searching during indexing didn't have a race 
> condition bite you (yes, it can still happen, but it's rare).

Ya, the reason was so swish-e didn't write to a currently active index
and also so if there was an error your old index would not be wiped
out.

I'd probably just use a shell script and rename directories -- but
almost the same thing.

-- 
Bill Moseley
moseley@hank.org

Unsubscribe from or help with the swish-e list: 
   http://swish-e.org/Discussion/

Help with Swish-e:
   http://swish-e.org/current/docs

_______________________________________________
Users mailing list
Users@lists.swish-e.org
http://lists.swish-e.org/listinfo/users
Received on Sun Apr 15 19:29:56 2007