How to use the SRU Service

Search/Retrieve via URL (SRU) is a standard protocol that can be used by websites and other computer programs to perform searches of websites over the internet by simply requesting a URL.

The nzresearch.org.nz website supports SRU version 1.1.

Using the SRU Service

Here is a simple form that will perform a query on this server. Your quey can be a single term (e.g. tussock), a phrase in quotes (e.g. "tussock grass"), a boolen AND search (e.g. tussock AND grass), a boolen OR search (e.g. tussock OR grass). See the section below on the Common Query Language for more options.

Query:
Start Record:
Max. Records:
Schema:
Output as RSS:

Behind the scenes

The SRU service can be accessed dierctly from:

http://nzresearch.org.nz/index.php/sru

Here is an example of a simple search for documents containing the query term tussock.

http://nzresearch.org.nz/index.php/sru? operation=searchRetrieve&version=1.1&query=tussock

SRU and the Common Query Language

Queries are encoded using the Common Query Language (CQL), and can be quite complicated.

The mandatory parameters of each query are operation (searchRetrieve and explain are currently implemented), version (current 1.1), and query (URL-encoded CQL). The optional parameters are maximumRecords, startRecord, and recordSchema (see below).

nzresearch.org.nz supports queries that conform to CQL level 1 using SRU version 1.1.

See the CQL homepage for more information. Note that the Common Query Language has been renamed to the Contextual Query Language as of version 1.2.

Using the recordSchema parameter

The recordSchema parameter can be set to three values, depending on the metadata sets that you want to return: dc, nzir_internal, and nzir_admin. The default is dc, which returns the Dublin Core metadata records that nzresearch.org.nz harvested from the source repository.

Here are some examples of SRU queries using the recordSchema parameter: