Sru
From DLXS Documentation
(→Sample Requests) |
|||
Line 35: | Line 35: | ||
<p>This implementation of <tt>sru</tt> just implements the <tt>explain</tt> operation and the <tt>searchRetrieve</tt> operation. The <tt>explain</tt> operation identifies the repository. There are two ways to make an <tt>explain</tt> request-- one is to not pass any parameters and the other is to pass an <tt>explain</tt> request. The following two links from UM's implementation demonstrate this:</p> | <p>This implementation of <tt>sru</tt> just implements the <tt>explain</tt> operation and the <tt>searchRetrieve</tt> operation. The <tt>explain</tt> operation identifies the repository. There are two ways to make an <tt>explain</tt> request-- one is to not pass any parameters and the other is to pass an <tt>explain</tt> request. The following two links from UM's implementation demonstrate this:</p> | ||
- | <ul><li> | + | <ul><li>http://hti.umich.edu/cgi/s/sru/sru |
</li> | </li> | ||
<li> | <li> | ||
- | + | http://hti.umich.edu/cgi/s/sru/sru?operation=explain | |
</li> | </li> | ||
</ul> | </ul> | ||
Line 46: | Line 46: | ||
<ul> | <ul> | ||
<li> | <li> | ||
- | + | http://hti.umich.edu/cgi/s/sru/sru?query=law&#x-collid=oaister | |
</li> | </li> | ||
<li> | <li> | ||
- | + | http://hti.umich.edu/cgi/s/sru/sru?query=law&#x-collid=oaister&startRecord=1&maximumRecords=4 | |
</li> | </li> | ||
</ul> | </ul> |
Revision as of 14:43, 24 July 2007
Overview
sru is the CGI program that produces XML responses to SRU requests as dictated by the SRU protocol. Setting up sru will allow federated search engines/clients to search your Bib Class collections. To learn about the SRU protocol go to http://www.loc.gov/standards/sru/
Setup Default Parameters
The SRU protocol needs a default Bib Class collection to search, along with some other default values. During installation you will be prompted for the values of these default parameters, but you can also change them any time in /$DLXSROOT/cgi/s/sru/sru.cfg. Here is a list of the parameters that need to be set up for your particular institution:
- gDefaultCollection - The collid to search when no x-collid parameter is passed in the searchRetrieve operation. For UM the default is "oaister".
- gHost - The hosting site. For UM the value is "www.hti.umich.edu".
- gPort - The port of the site. For UM the value is "620".
- gDatabase - The name you are giving your SRU repository of data. For UM the value is "dlps".
- gTitle - A title describing your SRU gateway. For UM the value is "University of Michigan Gateway".
- gDescription - A description of your gateway. At UM the description is "SRU Gateway to University of Michigan DLPS Collections".
Also, you will need to add the Bib Class collections to the AUTH system for sru, so that this cgi tool can have access to them.
Sample Requests
This implementation of sru just implements the explain operation and the searchRetrieve operation. The explain operation identifies the repository. There are two ways to make an explain request-- one is to not pass any parameters and the other is to pass an explain request. The following two links from UM's implementation demonstrate this:
The other operation is searchRetrieve. This operation is used to request the number of hits for a particular search ( query ), and then retrieve the results from the search. The particular collection to search can be passed in the x-collid parameter. If no x-collid parameter is passed, then the configured default collection is searched. The SRU protocol allows very robust query requests, but it is not mandatory that all these query requests be SRU compliant. For now, we have chosen to implement only level 0 of the SRU CQL language (term-only searches). The following examples from UM show how the searchRetrieve operation can be used to request hits for a particular search, and then retrieve the first 4 records returned by the search: