Sru
From DLXS Documentation
Line 56: | Line 56: | ||
</li> | </li> | ||
</ul> | </ul> | ||
+ | |||
+ | ==Fielded searching== | ||
+ | |||
+ | We now support two types of queries. The first is the original "level 0" like query where just the search term is provided: | ||
+ | |||
+ | http://quod.lib.umich.edu/cgi/s/sru/sru?version=1.1&operation=searchRetrieve&startRecord=1&maximumRecords=20&x-collid=oaister&query=hessen | ||
+ | |||
+ | |||
+ | The second is a format where the fields can be specified in the search. For this, the following fields are supported for Bib Class: | ||
+ | |||
+ | <pre>title, creator, contributor, subject, description, publisher, date, rights, identifier, format, language, source</pre> | ||
+ | |||
+ | Search clauses can be strung together like this: <tt>creator=smith title=dog</tt>. An optional boolean operator (''and'' and ''or'', default is ''or'') can be used (''not'' is not supported) between the search clauses. The search term must be quoted if more than one term is used. The use of parenthesis to group search terms and sort order are not supported. Here are some more examples: | ||
+ | |||
+ | <pre> | ||
+ | http://quod.lib.umich.edu/cgi/s/sru/sru?version=1.1&operation=searchRetrieve&startRecord=1&maximumRecords=20&x-collid=oaister& | ||
+ | query=title=hessen publisher=European | ||
+ | query=title=hessen publisher="East European Studies" | ||
+ | query=title=hessen and publisher="East European Studies" | ||
+ | query=title=hessen or publisher="East European Studies" | ||
+ | </pre> | ||
+ | |||
[[#top|Top]] | [[#top|Top]] |
Revision as of 15:10, 8 August 2008
Main Page > Working with DLXS Components > Working with DLXS Utilities and Applications > sru
Contents |
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:
- http://quod.lib.umich.edu/cgi/s/sru/sru?query=law&#x-collid=oaister
- http://quod.lib.umich.edu/cgi/s/sru/sru?query=law&#x-collid=oaister&startRecord=1&maximumRecords=4
Fielded searching
We now support two types of queries. The first is the original "level 0" like query where just the search term is provided:
The second is a format where the fields can be specified in the search. For this, the following fields are supported for Bib Class:
title, creator, contributor, subject, description, publisher, date, rights, identifier, format, language, source
Search clauses can be strung together like this: creator=smith title=dog. An optional boolean operator (and and or, default is or) can be used (not is not supported) between the search clauses. The search term must be quoted if more than one term is used. The use of parenthesis to group search terms and sort order are not supported. Here are some more examples:
http://quod.lib.umich.edu/cgi/s/sru/sru?version=1.1&operation=searchRetrieve&startRecord=1&maximumRecords=20&x-collid=oaister& query=title=hessen publisher=European query=title=hessen publisher="East European Studies" query=title=hessen and publisher="East European Studies" query=title=hessen or publisher="East European Studies"