VuFind API Documentation

Backend extends AbstractBackend
in package
implements SimilarInterface, RetrieveBatchInterface, RandomInterface, ExtraRequestDetailsInterface, GetIdsInterface

SOLR backend.

Tags
category

VuFind

author

David Maus maus@hab.de

license

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

link
https://vufind.org

Interfaces, Classes, Traits and Enums

SimilarInterface
MLT feature interface definition.
RetrieveBatchInterface
Optional backend feature: retrieve batch of records.
RandomInterface
Random record retrieval feature interface definition.
ExtraRequestDetailsInterface
Optional backend feature: Get more information about requests.
GetIdsInterface
Optional backend feature: Get identifiers of records.

Table of Contents

$collectionFactory  : RecordCollectionFactoryInterface
Record collection factory.
$connector  : Connector
Connector.
$identifier  : string
Backend identifier.
$pageSize  : int
Limit for records per query in a batch retrieval.
$queryBuilder  : QueryBuilder
Query builder.
$similarBuilder  : SimilarBuilder
Similar records query builder.
__construct()  : void
Constructor.
alphabeticBrowse()  : array<string|int, mixed>
Obtain information from an alphabetic browse index.
getConnector()  : Connector
Return the SOLR connector.
getExtraRequestDetails()  : array<string|int, mixed>
Returns some extra details about the search.
getIdentifier()  : string
Return backend identifier.
getIds()  : RecordCollectionInterface
Perform a search and return record collection of only record identifiers.
getQueryBuilder()  : QueryBuilder
Return query builder.
getRecordCollectionFactory()  : RecordCollectionFactoryInterface
Return the record collection factory.
getSimilarBuilder()  : SimilarBuilder
Return similar records query builder.
random()  : RecordCollectionInterface
Get Random records
rawJsonSearch()  : string
Perform a search and return a raw response.
resetExtraRequestDetails()  : void
Clears all accumulated extra request details
retrieve()  : RecordCollectionInterface
Retrieve a single document.
retrieveBatch()  : RecordCollectionInterface
Retrieve a batch of documents.
search()  : RecordCollectionInterface
Perform a search and return record collection.
setIdentifier()  : void
Set the backend identifier.
setPageSize()  : void
Set the limit for batch queries
setQueryBuilder()  : void
Set the query builder.
setRecordCollectionFactory()  : void
Set the record collection factory.
setSimilarBuilder()  : void
Set the similar records query builder.
similar()  : RecordCollectionInterface
Return similar records.
terms()  : Terms
Return terms from SOLR index.
writeDocument()  : array<string|int, mixed>
Write a document to Solr. Return an array of details about the updated index.
createRecordCollection()  : RecordCollectionInterface
Create record collection.
debug()  : void
Log a debug message.
deserialize()  : array<string|int, mixed>
Deserialize JSON response.
injectResponseWriter()  : void
Inject response writer and named list implementation into parameters.
injectSourceIdentifier()  : RecordCollectionInterface
Inject source identifier in record collection and all contained records.
log()  : void
Send a message to the logger.
logError()  : void
Log an error message.
logWarning()  : void
Log a warning message.
refineBrowseException()  : void
Improve the exception message for alphaBrowse errors when appropriate.
workKeysSearch()  : RecordCollectionInterface
Return work expressions.

Properties

$pageSize

Limit for records per query in a batch retrieval.

protected int $pageSize = 100

Methods

__construct()

Constructor.

public __construct(Connector $connector) : void
Parameters
$connector : Connector

SOLR connector

Return values
void

alphabeticBrowse()

Obtain information from an alphabetic browse index.

public alphabeticBrowse(string $source, string $from, int $page[, int $limit = 20 ][, ParamBag $params = null ], int $offsetDelta) : array<string|int, mixed>
Parameters
$source : string

Name of index to search

$from : string

Starting point for browse results

$page : int

Result page to return (starts at 0)

$limit : int = 20

Number of results to return on each page

$params : ParamBag = null

Additional parameters

$offsetDelta : int

Delta to use when calculating page offset (useful for showing a few results above the highlighted row)

Return values
array<string|int, mixed>

getExtraRequestDetails()

Returns some extra details about the search.

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

getIdentifier()

Return backend identifier.

public getIdentifier() : string
Return values
string

getQueryBuilder()

Return query builder.

public getQueryBuilder() : QueryBuilder

Lazy loads an empty default QueryBuilder if none was set.

Return values
QueryBuilder

getSimilarBuilder()

Return similar records query builder.

public getSimilarBuilder() : SimilarBuilder

Lazy loads an empty default SimilarBuilder if none was set.

Return values
SimilarBuilder

rawJsonSearch()

Perform a search and return a raw response.

public rawJsonSearch(AbstractQuery $query, int $offset, int $limit[, ParamBag $params = null ]) : string
Parameters
$query : AbstractQuery

Search query

$offset : int

Search offset

$limit : int

Search limit

$params : ParamBag = null

Search backend parameters

Return values
string

resetExtraRequestDetails()

Clears all accumulated extra request details

public resetExtraRequestDetails() : void
Return values
void

setIdentifier()

Set the backend identifier.

public setIdentifier(string $identifier) : void
Parameters
$identifier : string

Backend identifier

Return values
void

setPageSize()

Set the limit for batch queries

public setPageSize(int $pageSize) : void
Parameters
$pageSize : int

Records per Query

Return values
void

setQueryBuilder()

Set the query builder.

public setQueryBuilder(QueryBuilder $queryBuilder) : void
Parameters
$queryBuilder : QueryBuilder

Query builder

Return values
void

setSimilarBuilder()

Set the similar records query builder.

public setSimilarBuilder(SimilarBuilder $similarBuilder) : void
Parameters
$similarBuilder : SimilarBuilder

Similar builder

Return values
void

terms()

Return terms from SOLR index.

public terms([string $field = null ][, string $start = null ][, int $limit = null ][, ParamBag $params = null ]) : Terms
Parameters
$field : string = null

Index field

$start : string = null

Starting term (blank for beginning of list)

$limit : int = null

Maximum number of terms

$params : ParamBag = null

Additional parameters

Return values
Terms

writeDocument()

Write a document to Solr. Return an array of details about the updated index.

public writeDocument(DocumentInterface $doc[, int|null $timeout = null ][, string $handler = 'update' ][, ParamBag|null $params = null ]) : array<string|int, mixed>
Parameters
$doc : DocumentInterface

Document to write

$timeout : int|null = null

Timeout value (null for default)

$handler : string = 'update'

Handler to use

$params : ParamBag|null = null

Search backend parameters

Return values
array<string|int, mixed>

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

deserialize()

Deserialize JSON response.

protected deserialize(string $json) : array<string|int, mixed>
Parameters
$json : string

Serialized JSON response

Tags
throws
BackendException

Deserialization error

Return values
array<string|int, mixed>

injectResponseWriter()

Inject response writer and named list implementation into parameters.

protected injectResponseWriter(ParamBag $params) : void
Parameters
$params : ParamBag

Parameters

Tags
throws
InvalidArgumentException

Response writer and named list implementation already set to an incompatible type.

Return values
void

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

Search results