An Introduction to the Search/Retrieve URL Service (SRU)
Scan operations list and enumerate the terms found in the remote database's index. Clients send scan re- quests and servers return lists of terms. The process is akin to browsing a back-of-the-book index where a person looks up a term in the back of a book and 'scans' the entries surrounding the term. At a minim- um, scan operations must include a scan clause (scanClause) and a version number parameter. The scan clause contains the term to look for in the index. A rudimentary request and response follow:
<scanResponse> <version>1.1</version> <terms> <term> <value>doesn't</value> <numberOfRecords>1</numberOfRecords> </term> <term> <value>dog</value> <numberOfRecords>1</numberOfRecords> </term> <term> <value>dogs</value> <numberOfRecords>2</numberOfRecords> </term> </terms> </scanResponse> </section>
SearchRetrieve operations are the heart of the matter. They provide the means to query the remote data- base and return search results. Queries must be articulated using the Common Query Language (CQL) . These queries can range from simple free text searches to complex Boolean operations with nested queries and proximity qualifications.
Servers do not have to implement every aspect of CQL, but they have to know how to return diagnostic messages when something is requested but not supported. The results of searchRetrieve operations can be returned in any number of formats, as specified via explain operations. Examples might include struc- tured but plain text streams or data marked up in XML vocabularies such as Dublin Core, MARCXML, MODS (Metadata Object Description Schema), etc. Below is a simple request for documents matching the free text query 'dogs':
In this case, the server returns three (3) hits and by default includes Dublin Core title and identifier ele- ments. The record itself is marked up in some flavor of XML as opposed to being encapsulated as a string embedded the XML:
<searchRetrieveResponse> <version>1.1</version> <numberOfRecords>3</numberOfRecords> <records> <record> <recordSchema>info:srw/schema/1/dc-v1.1</recordSchema>