VuFind API Documentation

Results extends Results
in package

Solr Reserves Search Parameters

Tags
category

VuFind

author

Demian Katz demian.katz@villanova.edu

author

Tuan Nguyen tuan@yorku.ca

license

http://opensource.org/licenses/gpl-2.0.php GNU General Public License

link

Main Page

Table of Contents

$backendId  : string
Search backend identifier.
$cursorMark  : null|string
CursorMark used for deep paging (e.g. OAI-PMH Server).
$errors  : array<string|int, mixed>
Any errors reported by the search backend
$extraSearchBackendDetails  : array<string|int, mixed>|null
Extra search details.
$filteredFacetCounts  : mixed
Counts of filtered-out facet values, indexed by field name.
$helpers  : array<string|int, mixed>
Helper objects
$hierarchicalFacetHelper  : HierarchicalFacetHelperInterface
Hierarchical facet helper
$maxScore  : null|float
Highest relevance of all the results
$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
$responseFacets  : array<string|int, mixed>
Field facets.
$responsePivotFacets  : array<string|int, mixed>
Pivot facets.
$responseQueryFacets  : array<string|int, mixed>
Query facets.
$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.
$spellingProcessor  : SpellingProcessor
Class to process spelling.
$spellingQuery  : string
Currently used spelling query, if any.
$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.
getCursorMark()  : null|string
Get cursorMark.
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
getFilteredFacetCounts()  : array<string|int, mixed>
Get counts of facet values filtered out by the HideFacetValueListener, indexed by field name.
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.
getPartialFieldFacets()  : array<string|int, mixed>
Get complete facet counts for several index fields
getPivotFacetList()  : ArrayObject
Returns data on pivot facets for the last search
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.
getSpellingProcessor()  : SpellingProcessor
Get spelling processor.
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.
setCursorMark()  : void
Set cursorMark.
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).
setSpellingProcessor()  : void
Set spelling processor.
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.
fixBadQuery()  : bool|AbstractQuery
Try to fix a query that caused a parser error.
fixBadQueryGroup()  : bool|QueryGroup
Support method for fixBadQuery().
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 = 'SolrReserves'

$cursorMark

CursorMark used for deep paging (e.g. OAI-PMH Server).

protected null|string $cursorMark = null

Set to '*' to start paging a request and use the new value returned from the search request for the next request.

$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

$filteredFacetCounts

Counts of filtered-out facet values, indexed by field name.

protected mixed $filteredFacetCounts = null

$helpers

Helper objects

protected array<string|int, mixed> $helpers = []

$maxScore

Highest relevance of all the results

protected null|float $maxScore = null

$notificationFrequency

How frequently will a user be notified about this search (0 = never)?

protected int $notificationFrequency = null

$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 = []

$responseFacets

Field facets.

protected array<string|int, mixed> $responseFacets = null

$responsePivotFacets

Pivot facets.

protected array<string|int, mixed> $responsePivotFacets = null

$responseQueryFacets

Query facets.

protected array<string|int, mixed> $responseQueryFacets = null

$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

$spellingQuery

Currently used spelling query, if any.

protected string $spellingQuery = ''

$startRecordOverride

Override (only for use in very rare cases)

protected int $startRecordOverride = null

$suggestions

Spelling suggestions

protected array<string|int, mixed> $suggestions = 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

getCursorMark()

Get cursorMark.

public getCursorMark() : null|string
Return values
null|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

getFilteredFacetCounts()

Get counts of facet values filtered out by the HideFacetValueListener, indexed by field name.

public getFilteredFacetCounts() : array<string|int, mixed>
Return values
array<string|int, mixed>

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
throws
Exception
Return values
int

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

getPartialFieldFacets()

Get complete facet counts for several index fields

public getPartialFieldFacets(array<string|int, mixed> $facetfields[, bool $removeFilter = true ][, int $limit = -1 ][, string $facetSort = null ][, int $page = null ][, bool $ored = false ]) : 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)

$page : int = null

1 based. Offsets results by limit.

$ored : bool = false

Whether or not facet is an OR facet or not

Return values
array<string|int, mixed>

list facet values for each index field with label and more bool

getPivotFacetList()

Returns data on pivot facets for the last search

public getPivotFacetList() : ArrayObject
Return values
ArrayObject

Flare-formatted object

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

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

setCursorMark()

Set cursorMark.

public setCursorMark(null|string $cursorMark) : void
Parameters
$cursorMark : null|string

New cursor mark

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

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

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

fixBadQueryGroup()

Support method for fixBadQuery().

protected fixBadQueryGroup(QueryGroup $query) : bool|QueryGroup
Parameters
$query : QueryGroup

Query to fix

Return values
bool|QueryGroup

Fixed query, or false if no solution is found.

getSearchService()

Return search service.

protected getSearchService() : Service
Tags
todo

May better error handling, throw a custom exception if search service not present

Return values
Service

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
Return values
void

Search results