Koha::SuggestionEngine::Base - Base class for SuggestionEngine plugins
use base qw(Koha::SuggestionEngine::Base);
Base class for suggestion engine plugins. SuggestionEngines must provide the following methods:
get_suggestions (\%param) - get suggestions for the search described in $param->{'search'}, and return them in a hashref with the suggestions as keys and relevance as values.
NAME - return a string with the name of the plugin.
VERSION - return a string with the version of the plugin.
These methods may be overriden:
initialize (%params) - initialize the plugin
destroy () - destroy the plugin
These methods should not be overridden unless you are very sure of what you are doing:
new () - create a new plugin object
my $plugin = Koha::SuggestionEngine::Base->new;
Create a new filter;
$plugin->initalize(%params);
Initialize a filter using the specified parameters.
$plugin->destroy();
Destroy the filter.
my $suggestions = $plugin->get_suggestions(\%param);
Return suggestions for the specified search.