Wiki::...lucene(3pm)

πŸ“¦
version 0.86 Β· 3 versions
, in debian bookworm, debian trixie, ubuntu jammy, ubuntu noble, ubuntu resolute, ubuntu stonking

πŸ¦‹ NAME πŸ¦‹

okay so this is the manual page for Wiki::Toolkit::Search::Plucene, and it's literally the module that lets you use Plucene to search your Wiki::Toolkit wiki. that's the whole ✨ name ✨ vibe.


πŸ’… SYNOPSIS πŸ’…

here's the quick little how-to, bestie:

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

and yeah β€” it provides search-related methods for Wiki::Toolkit. slay.


✨ METHODS ✨

πŸ”₯ new πŸ”₯

this is the constructor, main character energy. behold:

             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 parameters, decoded πŸŽ€

  • path β€” this one is mandatory, no cap. path must be a directory for storing the indexed data. it should exist and be writeable.
  • content_munger β€” optional, bestie. it should be a reference to a subroutine. that sub takes the node content as a string and returns another string β€” and that returned string is what gets indexed in place of the original content.
  • node_filter β€” also optional. it should be a reference to a subroutine. the sub gets the named arguments node and content, and returns either true (yes, index this node) or false (no, don't index this node).
the order that matters: content munging takes place BEFORE node filtering. munging first, filtering second β€” don't flip it, okay? πŸ’–

🌈 SEE ALSO 🌈

  • Wiki::Toolkit
  • Wiki::Toolkit::Search::Base

that's the whole page! πŸ’– brought to you by perl v5.32.0, dated 2021-01-04, and filed under Wiki::...lucene(3pm) β€” mwah πŸ’‹

πŸ“¦ where this page comes from