source: trunk/examples/reindex.pl @ 604

Last change on this file since 604 was 604, checked in by kake, 17 years ago

Extended config changes to examples/reindex.pl

  • Property svn:eol-style set to native
  • Property svn:executable set to *
  • Property svn:keywords set to Author Date Id Revision
File size: 575 bytes
Line 
1#!/usr/bin/perl
2
3use strict;
4use warnings;
5
6use OpenGuides::Config;
7use OpenGuides::Utils;
8
9# This is a simple script to reindex every node in the wiki, useful if
10# your indexes got screwed up or you're swapping to a different searcher.
11
12my $config = OpenGuides::Config->new( file => "wiki.conf" );
13my $wiki = OpenGuides::Utils->make_wiki_object( config => $config );
14
15my @nodes = $wiki->list_all_nodes;
16foreach my $node ( sort @nodes ) {
17    my $content = $wiki->retrieve_node( $node );
18    $wiki->search_obj->index_node( $node, $content );
19    print "Reindexed $node\n";
20}
Note: See TracBrowser for help on using the repository browser.