This document provides an overview of the Simple Record Web (SRU) protocol and how it can be used with Lucene to provide search and retrieval of XML database records. It describes key SRU features like explain records, CQL query grammar, persistent result sets, XML record returns, and index browsing. It also provides details and examples of how to configure an SRU server using Lucene by modifying configuration files and properties.
QCon London: Mastering long-running processes in modern architectures
OCLC Online Computer Library Center's SRU and Lucene: An Introduction
1. O C LC O n lin e C o m p u te r Lib rary C e n te r
SRU and Lucene
Ralph LeVan
Research Scientist
levan@oclc.org
2. SRU Overview
A Simple Web Service
– Supports REST-ful and SOAP requests
– Responses are always XML records
Supports Search and Retrieve
Uses a Standard Query Grammar
Supports Self-Configuring Clients
A Gateway to Local Databases
3. SRU Features
Explain Records
CQL Query Grammar
Persistent Result Sets
XML Database Records Returned
Index Browses
Stylesheets
4. Explain Records
serverInfo
databaseInfo
metaInfo
indexInfo
schemaInfo
configInfo
7. metaInfo
From SRWDatabase.props
– metaInfo.dateModified
– metaInfo.aggregatedFrom
– metaInfo.dateAggregated
8. indexInfo
Generated Automatically
– “local” index set and Lucene index names
From SRWDatabase.props
– qualifier.<indexSet>.<indexName> =
<LuceneIndexName>
– Used only if you want to map other index
names to your Lucene indexes (e.g.
qualifier.dc.identifier=id)
10. schemaInfo Example
xmlSchemas=LuceneDocument, DC
LuceneDocument.identifier=info:srw/schema/1/L
uceneDocument
LuceneDocument.location=http://www.oclc.org/
standards/Lucene/schema/LuceneDocument.x
sd
LuceneDocument.namespace=http://www.oclc.o
rg/LuceneDocument
LuceneDocument.title=Lucene Demo Database
records in their internal format
11. schemaInfo Example (cont.)
DC.identifier=info:srw/schema/1/dc-v1.1
DC.location=http://www.loc.gov/zing/srw
/dc-schema.xsd
DC.title=DC: Dublin Core Elements
DC.transformer=LuceneToDC.xsl
18. Making the Magic Happen
Drop the SRWLucene.war into your
<tomcat>/webapps directory
Restart Tomcat
Edit
<tomcat>/webapps/SRWLucene/WEB-
INF/classes/SRWServer.props
Restart Tomcat