Sru

From DLXS Documentation

Jump to: navigation, search

Main Page > Working with DLXS Components > Working with DLXS Utilities and Applications > sru

Contents

[edit] 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/

[edit] 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.

[edit] 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:

[edit] Fielded Searching

DLXS sru supports two types of queries. The first is the original Level 0 query in which just the search term is provided, e.g., query for "hessen" anywhere:

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 in which the fields can be specified in the search. For this, the following fields are supported for Bibliographic 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 between the search clauses. The search term must be quoted if more than one term is used. The use of parentheses to group search terms, not as a boolean operator 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"

If you would like to combine a fielded search with a search anywhere within the record, use the all keyword. This will search for hessen anywhere and Untermann with the creator field:

  http://quod.lib.umich.edu/cgi/s/sru/sru?
    version=1.1&operation=searchRetrieve&startRecord=1&
    maximumRecords=20&x-collid=oaister&query=all=hessen and creator=Untermann

These changes provide for some fielded searching, but are not Level 1 or Level 2 compliant with the SRU specification. A workaround was considered the best option due to the decreasing use of Bibliographic Class and the level of effort necessary to comply to a higher Level of the specification.

Top

Personal tools