On Sun 21 Dec 2003, Matt Harvey matt@red-redemption.com wrote:
I made a few entries on the London openguide tonight, and in each instance received an error similar to this when commiting the edit:
Search::InvertedIndex::add_index() - Unable to read 'ie_000000000be6' record. Database may be corrupt. at /home/earle/openguides.org/lib/CGI/Wiki/Search/SII.pm line 204
Yeah - we seem to have some issues with the (Berkeley DB) indexes becoming corrupted. The solution we're using at the moment is just to delete and rebuild the indexes. This is not ideal.
Earle - here's the current reindexing script. It's pretty simple.
---------------------------------------------------------------------- #!/usr/local/bin/perl use strict; use warnings; use Config::Tiny; use OpenGuides::Utils;
my $config = Config::Tiny->read('wiki.conf'); my $wiki = OpenGuides::Utils->make_wiki_object( config => $config );
my @nodes = $wiki->list_all_nodes; foreach my $node ( @nodes ) { my $content = $wiki->retrieve_node( $node ); $wiki->search_obj->index_node( $node, $content ); print "Reindexed $node\n"; } ----------------------------------------------------------------------
This version doesn't bugger up recent changes.
Kake