<<

NAME

Koha::SuggestionEngine::Base - Base class for SuggestionEngine plugins

SYNOPSIS

  use base qw(Koha::SuggestionEngine::Base);

DESCRIPTION

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

FUNCTIONS

new

    my $plugin = Koha::SuggestionEngine::Base->new;

Create a new filter;

initialize

    $plugin->initalize(%params);

Initialize a filter using the specified parameters.

destroy

    $plugin->destroy();

Destroy the filter.

get_suggestions

    my $suggestions = $plugin->get_suggestions(\%param);

Return suggestions for the specified search.

<<