VuFind API Documentation

Explanation extends Explanation
in package

Solr Explanation

Tags
category

VuFind

author

Dennis Schrittenlocher Dennis.Schrittenlocher@outlook.de

author

Thomas Wagener wagener@hebis.uni-frankfurt.de

license

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

link

Main Page

Table of Contents

$baseScore  : float
Relevance score of the title with the recordId without modifiers (boost / coord).
$boost  : float
Value of boost.
$config  : Config
Configuration
$coord  : float
Value of coord. If only 2 out of 4 search query parts match, then coord would be 1/2.
$explanation  : array<string|int, mixed>
The main result of the explain class, an array with every match and its values.
$explanationForRest  : array<string|int, mixed>
Contains the fields that were removed from the main explanation.
$lookfor  : string
Search string used for query.
$maxScore  : float
Value of the relevance score of the best match.
$params  : Params
Search parameters object
$recordId  : string
RecordId of title the explanation is built for.
$rest  : array<string|int, mixed>|null
Describes the rest. It has restValue and the percentage from total value.
$searchIni  : string
Configuration file to read search settings from
$searchService  : Service
Search Service
$totalScore  : float
Relevance score of the title with the recordId.
__construct()  : mixed
Constructor
getBaseScore()  : float
Get relevance score of this title without modifier (boost/coord).
getBoost()  : float
Get value of the boost used in Solr query.
getCoord()  : float
Get value of coord.
getDecimalPlaces()  : int
Get number of decimal places for to be shown in the explanation.
getExplanation()  : array<string|int, mixed>
Get the explanation, parsed from Solr response.
getExplanationForRest()  : array<string|int, mixed>
Get the explanation for the rest.
getLookfor()  : string
Get the search string used for query.
getMaxFields()  : int
Get the maximal number of fields to be included.
getMaxScore()  : float
Get relevance value of best scoring title.
getMinPercentage()  : float
Get the minimal percentage for fields to be included.
getParams()  : Params
Get the search parameters object.
getRecordId()  : string
Get the record id of title the explanation is built for.
getRest()  : array<string|int, mixed>
Get rest. It has restValue and the percentage from total value.
getTotalScore()  : float
Get relevance score of this title.
performRequest()  : void
Performing request and creating explanation.
build()  : void
Builds explanation and sets up debug message to see raw Solr response.
buildRecursive()  : string
Goes through each line of explainOther response adding a matched field to $explanation.
cleanLines()  : array<string|int, mixed>
Norms the response by replacing expressions to support all versions of Solr. Removes empty lines.
debug()  : void
Log a debug message.
getChildLines()  : array<string|int, mixed>
Gets all lines with one level higher than the parent line.
getLevel()  : int
Returns indent of a line.
log()  : void
Send a message to the logger.
logError()  : void
Log an error message.
logWarning()  : void
Log a warning message.
parseExplainElement()  : array<string|int, mixed>
Unites all infos of a match to an explainElement.
parseLine()  : array<string|int, mixed>
Extracts value and description of a line.

Properties

$baseScore

Relevance score of the title with the recordId without modifiers (boost / coord).

protected float $baseScore

$coord

Value of coord. If only 2 out of 4 search query parts match, then coord would be 1/2.

protected float $coord

It adjusts the score so that the 2 other search query parts also influence the score.

$explanation

The main result of the explain class, an array with every match and its values.

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

$explanationForRest

Contains the fields that were removed from the main explanation.

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

$lookfor

Search string used for query.

protected string $lookfor

$maxScore

Value of the relevance score of the best match.

protected float $maxScore

$recordId

RecordId of title the explanation is built for.

protected string $recordId

$rest

Describes the rest. It has restValue and the percentage from total value.

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

$searchIni

Configuration file to read search settings from

protected string $searchIni = 'searches'

$totalScore

Relevance score of the title with the recordId.

protected float $totalScore

Methods

getBaseScore()

Get relevance score of this title without modifier (boost/coord).

public getBaseScore() : float
Return values
float

getBoost()

Get value of the boost used in Solr query.

public getBoost() : float
Return values
float

getCoord()

Get value of coord.

public getCoord() : float
Return values
float

getDecimalPlaces()

Get number of decimal places for to be shown in the explanation.

public getDecimalPlaces() : int
Return values
int

getExplanation()

Get the explanation, parsed from Solr response.

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

getExplanationForRest()

Get the explanation for the rest.

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

getLookfor()

Get the search string used for query.

public getLookfor() : string
Return values
string

getMaxFields()

Get the maximal number of fields to be included.

public getMaxFields() : int
Return values
int

getMaxScore()

Get relevance value of best scoring title.

public getMaxScore() : float
Return values
float

getMinPercentage()

Get the minimal percentage for fields to be included.

public getMinPercentage() : float
Return values
float

getRecordId()

Get the record id of title the explanation is built for.

public getRecordId() : string
Return values
string

getRest()

Get rest. It has restValue and the percentage from total value.

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

getTotalScore()

Get relevance score of this title.

public getTotalScore() : float
Return values
float

performRequest()

Performing request and creating explanation.

public performRequest(string $recordId) : void
Parameters
$recordId : string

Record Id

Tags
throws
BackendException
Return values
void

build()

Builds explanation and sets up debug message to see raw Solr response.

protected build(array<string|int, mixed> $response, string $recordId) : void
Parameters
$response : array<string|int, mixed>

Solr response

$recordId : string

recordId of title for Solr explainOther

Tags
throws
BackendException
Return values
void

buildRecursive()

Goes through each line of explainOther response adding a matched field to $explanation.

protected buildRecursive(array<string|int, mixed> $lines, float $modifier) : string
Parameters
$lines : array<string|int, mixed>

Solr lines

$modifier : float

1 (* tieValue)

Tags
throws
BackendException
Return values
string

Solr lines without the last inspected line

cleanLines()

Norms the response by replacing expressions to support all versions of Solr. Removes empty lines.

protected cleanLines(string $lines) : array<string|int, mixed>
Parameters
$lines : string

raw lines

Return values
array<string|int, mixed>

normed lines

debug()

Log a debug message.

protected debug(string $msg[, array<string|int, mixed> $context = [] ][, bool $prependClass = true ]) : void
Parameters
$msg : string

Log message

$context : array<string|int, mixed> = []

Log context

$prependClass : bool = true

Prepend class name to message?

Return values
void

getChildLines()

Gets all lines with one level higher than the parent line.

protected getChildLines(array<string|int, mixed> $lines, int $level) : array<string|int, mixed>
Parameters
$lines : array<string|int, mixed>

Lines

$level : int

Level

Return values
array<string|int, mixed>

getLevel()

Returns indent of a line.

protected getLevel(string $line) : int
Parameters
$line : string

Line

Return values
int

log()

Send a message to the logger.

protected log(string $level, string $message[, array<string|int, mixed> $context = [] ][, bool $prependClass = false ]) : void
Parameters
$level : string

Log level

$message : string

Log message

$context : array<string|int, mixed> = []

Log context

$prependClass : bool = false

Prepend class name to message?

Return values
void

logError()

Log an error message.

protected logError(string $msg[, array<string|int, mixed> $context = [] ][, bool $prependClass = true ]) : void
Parameters
$msg : string

Log message

$context : array<string|int, mixed> = []

Log context

$prependClass : bool = true

Prepend class name to message?

Return values
void

logWarning()

Log a warning message.

protected logWarning(string $msg[, array<string|int, mixed> $context = [] ][, bool $prependClass = true ]) : void
Parameters
$msg : string

Log message

$context : array<string|int, mixed> = []

Log context

$prependClass : bool = true

Prepend class name to message?

Return values
void

parseExplainElement()

Unites all infos of a match to an explainElement.

protected parseExplainElement(float $value, string $description, float $percentage, float $fieldModifier) : array<string|int, mixed>
Parameters
$value : float

Value

$description : string

Description

$percentage : float

Percentage

$fieldModifier : float

Field Modifier

Return values
array<string|int, mixed>

parseLine()

Extracts value and description of a line.

protected parseLine(string $line) : array<string|int, mixed>
Parameters
$line : string

Line

Return values
array<string|int, mixed>

Search results