Documentation

SearchInterface

Interface for classes implementing OAI-PMH resources search.

For performance reasons the search should be implemented as a single SPARQL query gathering all data needed to generate the OAI-PMH

resource descriptions.

Good implementation takes into account search query extensions provided by requested metadata format class. Such extension can be gathered by calling the static method extendSearchQuery() (see the acdhOeaw\arche\oaipmh\metadataMetadataInterface) on the metadata class. The metadata class is provided by the class method of the metadata format descriptor (see the __construct() method).

Tags
author

zozlak

Table of Contents

Methods

__construct()  : mixed
Creates a search engine object.
checkResumptionTimeout()  : bool
Checks if the timeout for resumption token generation has been reached.
find()  : void
Performs search using given filter values.
findResumptionToken()  : string
Reads search results based on the resumption token.
getCount()  : int
Returns number of resources matching last search (last call of the `find()` method).
getHeader()  : HeaderData
Provides the `HeaderData` object for a given search result.
getMetadata()  : MetadataInterface
Provides the `MetadataInterface` object for a given search result.
getResumptionToken()  : ResumptionTokenData
Saves the current search in a way it can be recreated from the resumption token and returns the resumption token data.
setLogger()  : void
Sets a logger for the search object
setMetadataFormat()  : void
Sets metadata format configuration

Methods

checkResumptionTimeout()

Checks if the timeout for resumption token generation has been reached.

public checkResumptionTimeout() : bool

If it is reached, returns true.

Return values
bool

find()

Performs search using given filter values.

public find(string $id, string $from, string $until, string $set) : void
Parameters
$id : string

id filter value

$from : string

date from filter value

$until : string

date to filter value

$set : string

set filter value

findResumptionToken()

Reads search results based on the resumption token.

public findResumptionToken(string $token) : string
Parameters
$token : string
Return values
string

getCount()

Returns number of resources matching last search (last call of the `find()` method).

public getCount() : int
Return values
int

getHeader()

Provides the `HeaderData` object for a given search result.

public getHeader(int $pos) : HeaderData
Parameters
$pos : int

seach result resource index

Return values
HeaderData

getMetadata()

Provides the `MetadataInterface` object for a given search result.

public getMetadata(int $pos) : MetadataInterface

The exact class of the returned object is defined by the class field of the metadata descriptor (see the $format parameter of the constructor method).

Parameters
$pos : int

seach result resource index

Return values
MetadataInterface

getResumptionToken()

Saves the current search in a way it can be recreated from the resumption token and returns the resumption token data.

public getResumptionToken(int $pos) : ResumptionTokenData
Parameters
$pos : int

index of last read resource

Return values
ResumptionTokenData

setLogger()

Sets a logger for the search object

public setLogger(AbstractLogger $log) : void
Parameters
$log : AbstractLogger

        
On this page

Search results