Results
in package
Abstract results search model.
This abstract class defines the results methods for modeling a search in VuFind.
Tags
Table of Contents
- $backendId : string
- Search backend identifier.
- $errors : array<string|int, mixed>
- Any errors reported by the search backend
- $extraSearchBackendDetails : array<string|int, mixed>|null
- Extra search details.
- $helpers : array<string|int, mixed>
- Helper objects
- $hierarchicalFacetHelper : HierarchicalFacetHelperInterface
- Hierarchical facet helper
- $notificationFrequency : int
- How frequently will a user be notified about this search (0 = never)?
- $params : Params
- Search parameters
- $queryEndTime : float
- Query end time
- $queryStartTime : float
- Query start time
- $queryTime : float
- Query time (total)
- $recommend : array<string|int, mixed>
- Recommendations
- $recordLoader : Loader
- Record loader
- $results : array<string|int, mixed>
- Array of results (represented as Record Driver objects) retrieved on latest search
- $resultTotal : int
- Total number of results available
- $savedSearch : bool
- Is this a user-saved search?
- $searchId : int
- An ID number for saving/retrieving search
- $searchService : Service
- Search service.
- $startRecordOverride : int
- Override (only for use in very rare cases)
- $suggestions : array<string|int, mixed>
- Spelling suggestions
- $urlQueryHelperFactory : UrlQueryHelperFactory
- URL query helper factory
- __clone() : void
- Copy constructor
- __construct() : mixed
- Constructor
- deminify() : void
- Restore settings from a minified object found in the database.
- getBackendId() : string
- Basic 'getter' of search backend identifier.
- getEndRecord() : int
- Get record number for end of range represented by current result set.
- getErrors() : array<string|int, mixed>
- Basic 'getter' for errors.
- getExtraData() : array<string|int, mixed>
- Get extra data for the search.
- getExtraSearchBackendDetails() : array<string|int, mixed>|null
- Get the extra search details
- getFacetList() : array<string|int, mixed>
- Returns the stored list of facets for the last search
- getFullFieldFacets() : array<string|int, mixed>
- Get complete facet counts for several index fields
- getMaxScore() : float|null
- Getting the highest relevance of all the results
- getNotificationFrequency() : int
- How frequently (in days) will the current user be notified about updates to these search results (0 = never)?
- getOptions() : Options
- Get the search options object.
- getPaginator() : Paginator
- Get a paginator for the result set.
- getParams() : Params
- Get the search parameters object.
- getQuerySpeed() : float
- Basic 'getter' for query speed.
- getRawSuggestions() : array<string|int, mixed>
- Basic 'getter' for suggestion list.
- getRecommendations() : array<string|int, mixed>
- Get an array of recommendation objects for augmenting the results display.
- getResults() : array<string|int, mixed>
- Basic 'getter' for search results.
- getResultTotal() : int
- Get total count of records in the result set (not just current page).
- getScores() : array<string|int, mixed>
- Get the scores of the results
- getSearchId() : int
- Basic 'getter' for ID of saved search.
- getSpellingSuggestions() : array<string|int, mixed>
- Get spelling suggestion information.
- getStartRecord() : int
- Get record number for start of range represented by current result set.
- getStartTime() : float
- Basic 'getter' for query start time.
- getUrlQuery() : UrlQueryHelper
- Get the URL helper for this object.
- isSavedSearch() : bool
- Is the current search saved in the database?
- minify() : void
- Add settings to a minified object.
- overrideStartRecord() : void
- Manually override the start record number.
- performAndProcessSearch() : void
- Actually execute the search.
- setExtraData() : void
- Set extra data for the search.
- setHelper() : void
- Override a helper object.
- setHierarchicalFacetHelper() : void
- Set hierarchical facet helper
- setParams() : void
- Set the search parameters object.
- setRecommendations() : void
- Set the recommendation objects (see \VuFind\Search\RecommendListener).
- setUrlQueryHelperFactory() : void
- Set URL query helper factory
- translate() : string
- Translate a string if a translator is available (proxies method in Options).
- updateSaveStatus() : void
- Given a database row corresponding to the current search object, mark whether this search is saved and what its database ID is.
- buildFacetList() : array<string|int, mixed>
- A helper method that converts the list of facets for the last search from RecordCollection's facet list.
- getSearchService() : Service
- Return search service.
- getUrlQueryHelperFactory() : UrlQueryHelperFactory
- Get URL query helper factory
- getUrlQueryHelperOptions() : array<string|int, mixed>
- Options for UrlQueryHelper
- performSearch() : void
- Abstract support method for performAndProcessSearch -- perform a search based on the parameters passed to the object. This method is responsible for filling in all of the key class properties: results, resultTotal, etc.
- startQueryTimer() : void
- Start the timer to figure out how long a query takes. Complements stopQueryTimer().
- stopQueryTimer() : void
- End the timer to figure out how long a query takes. Complements startQueryTimer().
Properties
$backendId
Search backend identifier.
protected
string
$backendId
$errors
Any errors reported by the search backend
protected
array<string|int, mixed>
$errors
= null
$extraSearchBackendDetails
Extra search details.
protected
array<string|int, mixed>|null
$extraSearchBackendDetails
= null
$helpers
Helper objects
protected
array<string|int, mixed>
$helpers
= []
$hierarchicalFacetHelper
Hierarchical facet helper
protected
HierarchicalFacetHelperInterface
$hierarchicalFacetHelper
= null
$notificationFrequency
How frequently will a user be notified about this search (0 = never)?
protected
int
$notificationFrequency
= null
$params
Search parameters
protected
Params
$params
$queryEndTime
Query end time
protected
float
$queryEndTime
= null
$queryStartTime
Query start time
protected
float
$queryStartTime
= null
$queryTime
Query time (total)
protected
float
$queryTime
= null
$recommend
Recommendations
protected
array<string|int, mixed>
$recommend
= []
$recordLoader
Record loader
protected
Loader
$recordLoader
$results
Array of results (represented as Record Driver objects) retrieved on latest search
protected
array<string|int, mixed>
$results
= null
$resultTotal
Total number of results available
protected
int
$resultTotal
= null
$savedSearch
Is this a user-saved search?
protected
bool
$savedSearch
= null
$searchId
An ID number for saving/retrieving search
protected
int
$searchId
= null
$searchService
Search service.
protected
Service
$searchService
$startRecordOverride
Override (only for use in very rare cases)
protected
int
$startRecordOverride
= null
$suggestions
Spelling suggestions
protected
array<string|int, mixed>
$suggestions
= null
$urlQueryHelperFactory
URL query helper factory
protected
UrlQueryHelperFactory
$urlQueryHelperFactory
= null
Methods
__clone()
Copy constructor
public
__clone() : void
Return values
void —__construct()
Constructor
public
__construct(Params $params, Service $searchService, Loader $recordLoader) : mixed
Parameters
- $params : Params
-
Object representing user search parameters.
- $searchService : Service
-
Search service
- $recordLoader : Loader
-
Record loader
Return values
mixed —deminify()
Restore settings from a minified object found in the database.
public
deminify(Minified $minified) : void
Parameters
- $minified : Minified
-
Minified Search Object
Return values
void —getBackendId()
Basic 'getter' of search backend identifier.
public
getBackendId() : string
Return values
string —getEndRecord()
Get record number for end of range represented by current result set.
public
getEndRecord() : int
Return values
int —getErrors()
Basic 'getter' for errors.
public
getErrors() : array<string|int, mixed>
Return values
array<string|int, mixed> —getExtraData()
Get extra data for the search.
public
getExtraData() : array<string|int, mixed>
Extra data can be used to store local implementation-specific information. Contents must be serializable. It is recommended to make the array as small as possible.
Return values
array<string|int, mixed> —getExtraSearchBackendDetails()
Get the extra search details
public
getExtraSearchBackendDetails() : array<string|int, mixed>|null
Return values
array<string|int, mixed>|null —getFacetList()
Returns the stored list of facets for the last search
public
abstract getFacetList([array<string|int, mixed> $filter = null ]) : array<string|int, mixed>
Parameters
- $filter : array<string|int, mixed> = null
-
Array of field => on-screen description listing all of the desired facet fields; set to null to get all configured values.
Return values
array<string|int, mixed> —Facets data arrays
getFullFieldFacets()
Get complete facet counts for several index fields
public
getFullFieldFacets(array<string|int, mixed> $facetfields[, bool $removeFilter = true ][, int $limit = -1 ][, string $facetSort = null ]) : array<string|int, mixed>
Parameters
- $facetfields : array<string|int, mixed>
-
name of the Solr fields to return facets for
- $removeFilter : bool = true
-
Clear existing filters from selected fields (true) or retain them (false)?
- $limit : int = -1
-
A limit for the number of facets returned, this may be useful for very large amounts of facets that can break the JSON parse method because of PHP out of memory exceptions (default = -1, no limit).
- $facetSort : string = null
-
A facet sort value to use (null to retain current)
Return values
array<string|int, mixed> —an array with the facet values for each index field
getMaxScore()
Getting the highest relevance of all the results
public
getMaxScore() : float|null
Return values
float|null —getNotificationFrequency()
How frequently (in days) will the current user be notified about updates to these search results (0 = never)?
public
getNotificationFrequency() : int
Tags
Return values
int —getOptions()
Get the search options object.
public
getOptions() : Options
Return values
Options —getPaginator()
Get a paginator for the result set.
public
getPaginator() : Paginator
Return values
Paginator —getParams()
Get the search parameters object.
public
getParams() : Params
Return values
Params —getQuerySpeed()
Basic 'getter' for query speed.
public
getQuerySpeed() : float
Return values
float —getRawSuggestions()
Basic 'getter' for suggestion list.
public
getRawSuggestions() : array<string|int, mixed>
Return values
array<string|int, mixed> —getRecommendations()
Get an array of recommendation objects for augmenting the results display.
public
getRecommendations([string $location = 'top' ]) : array<string|int, mixed>
Parameters
- $location : string = 'top'
-
Name of location to use as a filter (null to get associative array of all locations); legal non-null values: 'top', 'side'
Return values
array<string|int, mixed> —getResults()
Basic 'getter' for search results.
public
getResults() : array<string|int, mixed>
Return values
array<string|int, mixed> —getResultTotal()
Get total count of records in the result set (not just current page).
public
getResultTotal() : int
Return values
int —getScores()
Get the scores of the results
public
getScores() : array<string|int, mixed>
Return values
array<string|int, mixed> —getSearchId()
Basic 'getter' for ID of saved search.
public
getSearchId() : int
Return values
int —getSpellingSuggestions()
Get spelling suggestion information.
public
getSpellingSuggestions() : array<string|int, mixed>
Return values
array<string|int, mixed> —getStartRecord()
Get record number for start of range represented by current result set.
public
getStartRecord() : int
Return values
int —getStartTime()
Basic 'getter' for query start time.
public
getStartTime() : float
Return values
float —getUrlQuery()
Get the URL helper for this object.
public
getUrlQuery() : UrlQueryHelper
Return values
UrlQueryHelper —isSavedSearch()
Is the current search saved in the database?
public
isSavedSearch() : bool
Return values
bool —minify()
Add settings to a minified object.
public
minify(Minified &$minified) : void
Parameters
- $minified : Minified
-
Minified Search Object
Return values
void —overrideStartRecord()
Manually override the start record number.
public
overrideStartRecord(int $rec) : void
Parameters
- $rec : int
-
Record number to use.
Return values
void —performAndProcessSearch()
Actually execute the search.
public
performAndProcessSearch() : void
Return values
void —setExtraData()
Set extra data for the search.
public
setExtraData(array<string|int, mixed> $data) : void
Parameters
- $data : array<string|int, mixed>
-
Extra data
Return values
void —setHelper()
Override a helper object.
public
setHelper(string $key, object $value) : void
Parameters
- $key : string
-
Name of helper to set
- $value : object
-
Helper object
Return values
void —setHierarchicalFacetHelper()
Set hierarchical facet helper
public
setHierarchicalFacetHelper(HierarchicalFacetHelperInterface $helper) : void
Parameters
- $helper : HierarchicalFacetHelperInterface
-
Hierarchical facet helper
Return values
void —setParams()
Set the search parameters object.
public
setParams(Params $params) : void
Parameters
- $params : Params
-
Parameters to set
Return values
void —setRecommendations()
Set the recommendation objects (see \VuFind\Search\RecommendListener).
public
setRecommendations(array<string|int, mixed> $recommend) : void
Parameters
- $recommend : array<string|int, mixed>
-
Recommendations
Return values
void —setUrlQueryHelperFactory()
Set URL query helper factory
public
setUrlQueryHelperFactory(UrlQueryHelperFactory $factory) : void
Parameters
- $factory : UrlQueryHelperFactory
-
UrlQueryHelperFactory object
Return values
void —translate()
Translate a string if a translator is available (proxies method in Options).
public
translate() : string
Return values
string —updateSaveStatus()
Given a database row corresponding to the current search object, mark whether this search is saved and what its database ID is.
public
updateSaveStatus(SearchEntityInterface $row) : void
Parameters
- $row : SearchEntityInterface
-
Relevant database row.
Return values
void —buildFacetList()
A helper method that converts the list of facets for the last search from RecordCollection's facet list.
protected
buildFacetList(array<string|int, mixed> $facetList[, array<string|int, mixed> $filter = null ]) : array<string|int, mixed>
Parameters
- $facetList : array<string|int, mixed>
-
Facet list
- $filter : array<string|int, mixed> = null
-
Array of field => on-screen description listing all of the desired facet fields; set to null to get all configured values.
Return values
array<string|int, mixed> —Facets data arrays
getSearchService()
Return search service.
protected
getSearchService() : Service
Tags
Return values
Service —getUrlQueryHelperFactory()
Get URL query helper factory
protected
getUrlQueryHelperFactory() : UrlQueryHelperFactory
Return values
UrlQueryHelperFactory —getUrlQueryHelperOptions()
Options for UrlQueryHelper
protected
getUrlQueryHelperOptions() : array<string|int, mixed>
Return values
array<string|int, mixed> —performSearch()
Abstract support method for performAndProcessSearch -- perform a search based on the parameters passed to the object. This method is responsible for filling in all of the key class properties: results, resultTotal, etc.
protected
abstract performSearch() : void
Return values
void —startQueryTimer()
Start the timer to figure out how long a query takes. Complements stopQueryTimer().
protected
startQueryTimer() : void
Return values
void —stopQueryTimer()
End the timer to figure out how long a query takes. Complements startQueryTimer().
protected
stopQueryTimer() : void