Download Zebra - User's Guide and Reference

Transcript
Zebra - User’s Guide and
Reference
133 / 145
Other SRU operations
In the Z39.50 protocol, Initialization, Present, Sort and Close are separate operations. In SRU, however,
these operations do not exist.
• SRU has no explicit initialization handshake phase, but commences immediately with searching, scanning
and explain operations.
• Neither does SRU have a close operation, since the protocol is stateless and each request is self-contained.
(It is true that multiple SRU request/response pairs may be implemented as multiple HTTP request/response pairs over a single persistent TCP/IP connection; but the closure of that connection is not a
protocol-level operation.)
• Retrieval in SRU is part of the searchRetrieve operation, in which a search is submitted and the
response includes a subset of the records in the result set. There is no direct analogue of Z39.50’s Present
operation which requests records from an established result set. In SRU, this is achieved by sending a subsequent searchRetrieve request with the query cql.resultSetId=id where id is the identifier
of the previously generated result-set.
• Sorting in CQL is done within the searchRetrieve operation - in v1.1, by an explicit sort parameter, but the forthcoming v1.2 or v2.0 will most likely use an extension of the query language, CQL
sorting.
It can be seen, then, that while Zebra operating as an SRU server does not provide the same set of operations
as when operating as a Z39.50 server, it does provide equivalent functionality.
SRU Examples
Surf into http://localhost:9999 to get an explain response, or use
http://localhost:9999/?version=1.1&operation=explain
See number of hits for a query
http://localhost:9999/?version=1.1&operation=searchRetrieve
&query=text=(plant%20and%20soil)
Fetch record 5-7 in Dublin Core format
http://localhost:9999/?version=1.1&operation=searchRetrieve
&query=text=(plant%20and%20soil)
&startRecord=5&maximumRecords=2&recordSchema=dc
Even search using PQF queries using the extended naughty parameter x-pquery
http://localhost:9999/?version=1.1&operation=searchRetrieve
&x-pquery=@attr%201=text%20@and%20plant%20soil
Or scan indexes using the extended extremely naughty parameter x-pScanClause
http://localhost:9999/?version=1.1&operation=scan
&x-pScanClause=@attr%201=text%20something
Don’t do this in production code! But it’s a great fast debugging aid.