AuthorityRecommend
in package
implements
RecommendInterface
AuthorityRecommend Module
This class provides recommendations based on Authority records. i.e. searches for a pseudonym will provide the user with a link to the official name (according to the Authority index)
Originally developed at the National Library of Ireland by Lutz Biedinger and Ronan McHugh.
Tags
Interfaces, Classes, Traits and Enums
- RecommendInterface
- Search Recommendations Interface
Table of Contents
- $filters : array<string|int, mixed>
- Configured filters for authority searches
- $header : string
- Header to use in the user interface.
- $lookfor : string
- User search query
- $mode : string
- Which lookup mode(s) to use.
- $recommendations : array<string|int, mixed>
- Generated recommendations
- $resultLimit : int
- Maximum number of results that will be accompanied by recommendations (set to 0 for no limit).
- $results : Results
- Current user search
- $resultsManager : PluginManager
- Results plugin manager
- __construct() : mixed
- Constructor
- getHeader() : string
- Get the header to display in the user interface.
- getRecommendations() : array<string|int, mixed>
- Get recommendations (for use in the view).
- getResults() : Results
- Get results stored in the object.
- init() : void
- Called before the Search Results object performs its main search (specifically, in response to \VuFind\Search\SearchRunner::EVENT_CONFIGURED).
- process() : void
- Called after the Search Results object has performed its main search. This may be used to extract necessary information from the Search Results object or to perform completely unrelated processing.
- setConfig() : void
- Store the configuration of the recommendation module.
- addSeeAlsoReferences() : void
- Add "see also" headings from records that match search terms on main heading.
- addUseForHeadings() : void
- Add main headings from records that match search terms on use_for/see_also.
- fuzzyCompare() : bool
- Return true if $a and $b are similar enough to represent the same heading.
- isModeActive() : bool
- Is the specified mode configured to be active?
- performSearch() : array<string|int, mixed>
- Perform a search of the authority index.
Properties
$filters
Configured filters for authority searches
protected
array<string|int, mixed>
$filters
= []
$header
Header to use in the user interface.
protected
string
$header
= 'See also'
$lookfor
User search query
protected
string
$lookfor
$mode
Which lookup mode(s) to use.
protected
string
$mode
= '*'
$recommendations
Generated recommendations
protected
array<string|int, mixed>
$recommendations
= []
$resultLimit
Maximum number of results that will be accompanied by recommendations (set to 0 for no limit).
protected
int
$resultLimit
= 0
$results
Current user search
protected
Results
$results
$resultsManager
Results plugin manager
protected
PluginManager
$resultsManager
Methods
__construct()
Constructor
public
__construct(PluginManager $results) : mixed
Parameters
- $results : PluginManager
-
Results plugin manager
Return values
mixed —getHeader()
Get the header to display in the user interface.
public
getHeader() : string
Return values
string —getRecommendations()
Get recommendations (for use in the view).
public
getRecommendations() : array<string|int, mixed>
Return values
array<string|int, mixed> —getResults()
Get results stored in the object.
public
getResults() : Results
Return values
Results —init()
Called before the Search Results object performs its main search (specifically, in response to \VuFind\Search\SearchRunner::EVENT_CONFIGURED).
public
init(Params $params, Parameters $request) : void
This method is responsible for setting search parameters needed by the recommendation module and for reading any existing search parameters that may be needed.
Parameters
- $params : Params
-
Search parameter object
- $request : Parameters
-
Parameter object representing user request.
Tags
Return values
void —process()
Called after the Search Results object has performed its main search. This may be used to extract necessary information from the Search Results object or to perform completely unrelated processing.
public
process(Results $results) : void
Parameters
- $results : Results
-
Search results object
Return values
void —setConfig()
Store the configuration of the recommendation module.
public
setConfig(string $settings) : void
Parameters
- $settings : string
-
Settings from searches.ini.
Return values
void —addSeeAlsoReferences()
Add "see also" headings from records that match search terms on main heading.
protected
addSeeAlsoReferences() : void
Return values
void —addUseForHeadings()
Add main headings from records that match search terms on use_for/see_also.
protected
addUseForHeadings() : void
Return values
void —fuzzyCompare()
Return true if $a and $b are similar enough to represent the same heading.
protected
fuzzyCompare(string $a, string $b) : bool
Parameters
- $a : string
-
First string to compare
- $b : string
-
Second string to compare
Return values
bool —isModeActive()
Is the specified mode configured to be active?
protected
isModeActive(string $mode) : bool
Parameters
- $mode : string
-
Mode to check
Return values
bool —performSearch()
Perform a search of the authority index.
protected
performSearch(array<string|int, mixed> $params) : array<string|int, mixed>
Parameters
- $params : array<string|int, mixed>
-
Array of request parameters.