NAME

Wiki::Toolkit::Search::Plucene - Use Plucene to search your Wiki::Toolkit wiki.

SYNOPSIS

my $search = Wiki::Toolkit::Search::Plucene->new( path => "/var/plucene/wiki" );
my %wombat_nodes = $search->search_nodes("wombat");

Provides search-related methods for Wiki::Toolkit.

METHODS

new
my $search = Wiki::Toolkit::Search::Plucene->new(
                 path => "/var/plucene/wiki",
                 content_munger => sub {
                     my $content = shift;
                     $content =~ s/secretword//gs;
                     return $content;
                 },
                 node_filter => sub {
                     my %args = @_;
                     return $args{content} =~ /REDIRECT/ ? 0 : 1;
                 },
);

The path parameter is mandatory. path must be a directory for storing the indexed data. It should exist and be writeable.

The content_munger parameter is optional. It should be a reference to a subroutine which takes the node content as a string and returns another string which will be indexed in place of the original content.

The node_filter parameter is also optional. It should be a reference to a subroutine which takes the named arguments node and content, and returns either true (yes, index this node) or false (no, don't index this node).

Content munging takes place BEFORE node filtering.

SEE ALSO

Wiki::Toolkit, Wiki::Toolkit::Search::Base.