Koha::SuggestionEngine - Dispatcher class for suggestion engines
use Koha::SuggestionEngine; my $suggestor = Koha::SuggestionEngine->new(%params); $suggestor->get_suggestions($search)
Dispatcher class for retrieving suggestions. SuggestionEngines must extend Koha::SuggestionEngine::Base, be in the Koha::SuggestionEngine::Plugin namespace, and provide the following methods:
get_suggestions ($search) - get suggestions from the plugin for the specified search.
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 $suggestor = Koha::SuggestionEngine->new(%params);
Create a new suggestor class. Available parameters are:
What plugin(s) to use. This must be an arrayref to a list of plugins. Plugins can be specified either with a complete class path, or, if they are in the Koha::SuggestionEngine::Plugin namespace, as only the plugin name, and "Koha::SuggestionEngine::Plugin" will be prepended to it before the plugin is loaded.
my $suggestions = $suggester->get_suggestions(\%params)
Get a list of suggestions based on the search passed in. Available parameters are:
Required. The search for which suggestions are desired.
Optional. The number of suggestions to retrieve. Defaults to 10.
my @available_plugins = Koha::SuggestionEngine::AvailablePlugins();
Get a list of available plugins.