OCLC Online Computer Library Center SRU and Lucene
OCLC Online Computer Library Center SRU and Lucene Ralph Le. Van Research Scientist levan@oclc. org
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
SRU Features Explain Records CQL Query Grammar Persistent Result Sets XML Database Records Returned Index Browses Stylesheets
Explain Records server. Info database. Info meta. Info index. Info schema. Info config. Info
server. Info Generated Automatically – host – port – database
database. Info From SRWDatabase. props – database. Info. title – database. Info. description – database. Info. contact Provided Automatically – implementation
meta. Info From SRWDatabase. props – meta. Info. date. Modified – meta. Info. aggregated. From – meta. Info. date. Aggregated
index. Info Generated Automatically – “local” index set and Lucene index names From SRWDatabase. props – qualifier. <index. Set>. <index. Name> = <Lucene. Index. Name> – Used only if you want to map other index names to your Lucene indexes (e. g. qualifier. dc. identifier=id)
schema. Info Generated Automatically – Lucene. Document From SRWDatabase. props – xml. Schemas=<list of name> – <schema. Name>. identifier= – <schema. Name>. location= – <schema. Name>. namespace= – <schema. Name>. title= – [<schema. Name>. transformer=] – [<schema. Name>. resolver=]
schema. Info Example xml. Schemas=Lucene. Document, DC Lucene. Document. identifier=info: srw/schema/1/L ucene. Document Lucene. Document. location=http: //www. oclc. org/s tandards/Lucene/schema/Lucene. Document. xs d Lucene. Document. namespace=http: //www. oclc. o rg/Lucene. Document. title=Lucene Demo Database records in their internal format
schema. Info Example (cont. ) DC. identifier=info: srw/schema/1/dc-v 1. 1 DC. location=http: //www. loc. gov/zing/srw /dc-schema. xsd DC. title=DC: Dublin Core Elements DC. transformer=Lucene. To. DC. xsl
config. Info Generated Automatically – maximum. Records (20) – number. Of. Records (10) – result. Set. TTL (300) From SRWDatabase. props – config. Info. maximum. Records – config. Info. number. Of. Records – config. Info. result. Set. TTL
CQL Query Grammar Builtin: Basic. Lucene. Query. Translator Cql. Query. Translator – Query make. Query(CQLNode cn); – Term get. Term(); From SRWDatabase. props – SRWLucene. Database. Cql. To. Lucene. Query. Translator= <Class. Name>
Persistent Result Sets Builtin: Lucene. Query. Result
XML Database Records Builtin: Basic. Lucene. Record. Resolver – Void init(Properties props); – Record resolve(Document doc, String Id. Field. Name, Extra. Data. Type extra. Data. Type) From SRWDatabase. props – <schema. Name>. resolver=<Class. Name> – SRWLucene. Database. id. Field. Name= <Field. Name>
Index Browses Builtin: SRWLucene. Database. get. Terms()
Stylesheets From SRWDatabase. props – explain. Style. Sheet= /SRW/explain. Response. xsl – scan. Style. Sheet=/SRW/scan. Response. xsl – search. Style. Sheet= /SRW/search. Retrieve. Response. xsl
Making the Magic Happen Drop the SRWLucene. war into your <tomcat>/webapps directory Restart Tomcat Edit <tomcat>/webapps/SRWLucene/WEBINF/classes/SRWServer. props Restart Tomcat
Sample SRWServer. props db. Lucene. Demo. DB. class= ORG. oclc. os. SRW. Lucene. SRWLucene. Da tabase db. Lucene. Demo. DB. home= f: /lucene 2. 0. 0 db. Lucene. Demo. DB. configuration= SRWDatabase. props
Sample SRWDatabase. props database. Info. title=Lucene Demo Database database. Info. description=An index of the source code for Lucene database. Info. contact=Ralph Le. Van (levan@oclc. org) qualifier. cql. server. Choice=contents explain. Style. Sheet=/SRWLucene/explain. Response. xsl scan. Style. Sheet=/SRWLucene/scan. Response. xsl search. Style. Sheet= /SRWLucene/search. Retrieve. Response. xsl
Resources http: //www. oclc. org/research/software/srw http: //staff. oclc. org/~levan/SRWLucene. Source. jar http: //staff. oclc. org/~levan/SRWLucene. war http: //staff. oclc. org/~levan/Implementing%20 an%20 SRWLucene. Database. doc http: //staff. oclc. org/~levan/SRU%20 and%20 L ucene. ppt http: //alcme. oclc. org/srw/SRUServer. Tester. ht ml
- Slides: 21