CGI::Wiki::Search::DBIxFTS - DBIx::FullTextSearch search plugin for CGI::Wiki
DBIx::FullTextSearch
my $store = CGI::Wiki::Store::MySQL->new( dbname => "wiki", dbpass=>"wiki" ); my $search = CGI::Wiki::Search::DBIxFTS->new( dbh => $store->dbh ); my %wombat_nodes = $search->search_nodes("wombat");
Provides search-related methods for CGI::Wiki
my $search = CGI::Wiki::Search::DBIxFTS->new( dbh => $dbh );
You must supply a handle to a database that has the DBIx::FullTextSearch indexes already set up. (Currently though there's no checking that what you supply is even a database handle at all, let alone one that is compatible with DBIx::FullTextSearch.)
# Find all the nodes which contain both the word 'expert' and the # phrase 'wombat defenestration'. %results = $search->search_nodes('expert "wombat defenestration"'); # Find all the nodes which contain at least one of the words # 'buffy', 'pony', and 'pie'. %results = $search->search_nodes('buffy pony pie', 'OR');
Returns a (possibly empty) hash whose keys are the node names and whose values are the scores in some kind of relevance-scoring system I haven't entirely come up with yet. For OR searches, this could initially be the number of terms that appear in the node, perhaps.
Defaults to AND searches (if $and_or is not supplied, or is anything other than OR or or).
OR
or
Searches are case-insensitive.
$search->index_node($node);
Indexes or reindexes the given node in the FTS indexes in the backend storage.
$search->delete_node($node);
Removes the given node from the search indexes. NOTE: It's up to you to make sure the node is removed from the backend store. Croaks on error, returns true on success.
if ( $search->supports_phrase_searches ) { return $search->search_nodes( '"fox in socks"' ); }
Returns true if this search backend supports phrase searching, and false otherwise.
CGI::Wiki
To install CGI::Wiki, copy and paste the appropriate command in to your terminal.
cpanm
cpanm CGI::Wiki
CPAN shell
perl -MCPAN -e shell install CGI::Wiki
For more information on module installation, please visit the detailed CPAN module installation guide.