SlideShare a Scribd company logo
1 of 21
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
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
  serverInfo
  databaseInfo
  metaInfo
  indexInfo
  schemaInfo
  configInfo
serverInfo
  Generated Automatically
   – host
   – port
   – database
databaseInfo
  From SRWDatabase.props
   – databaseInfo.title
   – databaseInfo.description
   – databaseInfo.contact

  Provided Automatically
   – implementation
metaInfo
  From SRWDatabase.props
  – metaInfo.dateModified
  – metaInfo.aggregatedFrom
  – metaInfo.dateAggregated
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)
schemaInfo
  Generated Automatically
  – LuceneDocument
  From SRWDatabase.props
  –   xmlSchemas=<list of name>
  –   <schemaName>.identifier=
  –   <schemaName>.location=
  –   <schemaName>.namespace=
  –   <schemaName>.title=
  –   [<schemaName>.transformer=]
  –   [<schemaName>.resolver=]
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
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
configInfo
  Generated Automatically
   – maximumRecords (20)
   – numberOfRecords (10)
   – resultSetTTL (300)

  From SRWDatabase.props
   – configInfo.maximumRecords
   – configInfo.numberOfRecords
   – configInfo.resultSetTTL
CQL Query Grammar
  Builtin: BasicLuceneQueryTranslator
  CqlQueryTranslator
  – Query makeQuery(CQLNode cn);
  – Term getTerm();

  From SRWDatabase.props
  – SRWLuceneDatabase.
    CqlToLuceneQueryTranslator=
    <ClassName>
Persistent Result Sets
   Builtin: LuceneQueryResult
XML Database Records
  Builtin: BasicLuceneRecordResolver
  RecordResolver
  – Void init(Properties props);
  – Record resolve(Document doc, String
    IdFieldName, ExtraDataType
    extraDataType)
  From SRWDatabase.props
  – <schemaName>.resolver=<ClassName>
  – SRWLuceneDatabase.idFieldName=
    <FieldName>
Index Browses
  Builtin:
  SRWLuceneDatabase.getTerms()
Stylesheets
  From SRWDatabase.props
   – explainStyleSheet=
     /SRW/explainResponse.xsl
   – scanStyleSheet=/SRW/scanResponse.xsl
   – searchStyleSheet=
     /SRW/searchRetrieveResponse.xsl
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
Sample SRWServer.props
 db.LuceneDemoDB.class=
   ORG.oclc.os.SRW.Lucene.SRWLuceneDa
   tabase
 db.LuceneDemoDB.home=
   f:/lucene-2.0.0
 db.LuceneDemoDB.configuration=
   SRWDatabase.props
Sample SRWDatabase.props
 databaseInfo.title=Lucene Demo Database
 databaseInfo.description=An index of the source code for
   Lucene
 databaseInfo.contact=Ralph LeVan (levan@oclc.org)


 qualifier.cql.serverChoice=contents


 explainStyleSheet=/SRWLucene/explainResponse.xsl
 scanStyleSheet=/SRWLucene/scanResponse.xsl
 searchStyleSheet=
   /SRWLucene/searchRetrieveResponse.xsl
Resources
  http://www.oclc.org/research/software/srw
  http://
  staff.oclc.org/~levan/SRWLuceneSource.jar
  http://staff.oclc.org/~levan/SRWLucene.war
  http://staff.oclc.org/~levan/Implementing%20an%2
  http://staff.oclc.org/~levan/SRU%20and%20Lucene
  http://alcme.oclc.org/srw/SRUServerTester.html

More Related Content

What's hot

Less02 Installation
Less02 InstallationLess02 Installation
Less02 Installation
vivaankumar
 

What's hot (20)

Using Perl Stored Procedures for MariaDB
Using Perl Stored Procedures for MariaDBUsing Perl Stored Procedures for MariaDB
Using Perl Stored Procedures for MariaDB
 
PHP with MySQL
PHP with MySQLPHP with MySQL
PHP with MySQL
 
Installing Apache Hive, internal and external table, import-export
Installing Apache Hive, internal and external table, import-export Installing Apache Hive, internal and external table, import-export
Installing Apache Hive, internal and external table, import-export
 
Passing java arrays in oracle stored procedure from mule esb flow
Passing java arrays in oracle stored procedure from mule esb flowPassing java arrays in oracle stored procedure from mule esb flow
Passing java arrays in oracle stored procedure from mule esb flow
 
Less02 Installation
Less02 InstallationLess02 Installation
Less02 Installation
 
Postgresql
PostgresqlPostgresql
Postgresql
 
Cloning Oracle EBS R12: A Step by Step Procedure
Cloning Oracle EBS R12: A Step by Step ProcedureCloning Oracle EBS R12: A Step by Step Procedure
Cloning Oracle EBS R12: A Step by Step Procedure
 
Scoop Job, import and export to RDBMS
Scoop Job, import and export to RDBMSScoop Job, import and export to RDBMS
Scoop Job, import and export to RDBMS
 
Integrate with database by groovy
Integrate with database by groovyIntegrate with database by groovy
Integrate with database by groovy
 
Database programming
Database programmingDatabase programming
Database programming
 
Introduction to PostgreSQL
Introduction to PostgreSQLIntroduction to PostgreSQL
Introduction to PostgreSQL
 
.NetRAF 2017: Big data en Azure
.NetRAF 2017: Big data en Azure.NetRAF 2017: Big data en Azure
.NetRAF 2017: Big data en Azure
 
Jsp project module
Jsp project moduleJsp project module
Jsp project module
 
Oracle-L11 using Oracle flashback technology-Mazenet solution
Oracle-L11 using  Oracle flashback technology-Mazenet solutionOracle-L11 using  Oracle flashback technology-Mazenet solution
Oracle-L11 using Oracle flashback technology-Mazenet solution
 
Standby db creation commands
Standby db creation commandsStandby db creation commands
Standby db creation commands
 
OTN TOUR 2016 - DBA Commands and Concepts That Every Developer Should Know
OTN TOUR 2016 - DBA Commands and Concepts That Every Developer Should KnowOTN TOUR 2016 - DBA Commands and Concepts That Every Developer Should Know
OTN TOUR 2016 - DBA Commands and Concepts That Every Developer Should Know
 
Oracle flashback
Oracle flashbackOracle flashback
Oracle flashback
 
Introduction to Mongodb execution plan and optimizer
Introduction to Mongodb execution plan and optimizerIntroduction to Mongodb execution plan and optimizer
Introduction to Mongodb execution plan and optimizer
 
DBA Commands and Concepts That Every Developer Should Know
DBA Commands and Concepts That Every Developer Should KnowDBA Commands and Concepts That Every Developer Should Know
DBA Commands and Concepts That Every Developer Should Know
 
MuleSoft ESB scatter-gather and base64
MuleSoft ESB scatter-gather and base64MuleSoft ESB scatter-gather and base64
MuleSoft ESB scatter-gather and base64
 

Similar to Sru& and lucene

Developing RESTful WebServices using Jersey
Developing RESTful WebServices using JerseyDeveloping RESTful WebServices using Jersey
Developing RESTful WebServices using Jersey
b_kathir
 
Synchronize OpenLDAP with Active Directory with LSC project
Synchronize OpenLDAP with Active Directory with LSC projectSynchronize OpenLDAP with Active Directory with LSC project
Synchronize OpenLDAP with Active Directory with LSC project
Clément OUDOT
 
Odtug2011 adf developers make the database work for you
Odtug2011 adf developers make the database work for youOdtug2011 adf developers make the database work for you
Odtug2011 adf developers make the database work for you
Luc Bors
 
Using Ruby on Rails with legacy Oracle databases
Using Ruby on Rails with legacy Oracle databasesUsing Ruby on Rails with legacy Oracle databases
Using Ruby on Rails with legacy Oracle databases
Raimonds Simanovskis
 

Similar to Sru& and lucene (20)

Advance java session 5
Advance java session 5Advance java session 5
Advance java session 5
 
Deeply Declarative Data Pipelines
Deeply Declarative Data PipelinesDeeply Declarative Data Pipelines
Deeply Declarative Data Pipelines
 
Laravel intake 37 all days
Laravel intake 37 all daysLaravel intake 37 all days
Laravel intake 37 all days
 
les04.pdf
les04.pdfles04.pdf
les04.pdf
 
Developing RESTful WebServices using Jersey
Developing RESTful WebServices using JerseyDeveloping RESTful WebServices using Jersey
Developing RESTful WebServices using Jersey
 
OGSA-DAI DQP: A Developer's View
OGSA-DAI DQP: A Developer's ViewOGSA-DAI DQP: A Developer's View
OGSA-DAI DQP: A Developer's View
 
KMUTNB - Internet Programming 6/7
KMUTNB - Internet Programming 6/7KMUTNB - Internet Programming 6/7
KMUTNB - Internet Programming 6/7
 
Spring 3.1 to 3.2 in a Nutshell - Spring I/O 2012
Spring 3.1 to 3.2 in a Nutshell - Spring I/O 2012Spring 3.1 to 3.2 in a Nutshell - Spring I/O 2012
Spring 3.1 to 3.2 in a Nutshell - Spring I/O 2012
 
Jsp/Servlet
Jsp/ServletJsp/Servlet
Jsp/Servlet
 
JDBC.ppt
JDBC.pptJDBC.ppt
JDBC.ppt
 
Spring 3.1 in a Nutshell - JAX London 2011
Spring 3.1 in a Nutshell - JAX London 2011Spring 3.1 in a Nutshell - JAX London 2011
Spring 3.1 in a Nutshell - JAX London 2011
 
Spring Day | Spring 3.1 in a Nutshell | Sam Brannen
Spring Day | Spring 3.1 in a Nutshell | Sam BrannenSpring Day | Spring 3.1 in a Nutshell | Sam Brannen
Spring Day | Spring 3.1 in a Nutshell | Sam Brannen
 
Jdbc oracle
Jdbc oracleJdbc oracle
Jdbc oracle
 
ElasticSearch for .NET Developers
ElasticSearch for .NET DevelopersElasticSearch for .NET Developers
ElasticSearch for .NET Developers
 
Search Engine Building with Lucene and Solr (So Code Camp San Diego 2014)
Search Engine Building with Lucene and Solr (So Code Camp San Diego 2014)Search Engine Building with Lucene and Solr (So Code Camp San Diego 2014)
Search Engine Building with Lucene and Solr (So Code Camp San Diego 2014)
 
Synchronize OpenLDAP with Active Directory with LSC project
Synchronize OpenLDAP with Active Directory with LSC projectSynchronize OpenLDAP with Active Directory with LSC project
Synchronize OpenLDAP with Active Directory with LSC project
 
Odtug2011 adf developers make the database work for you
Odtug2011 adf developers make the database work for youOdtug2011 adf developers make the database work for you
Odtug2011 adf developers make the database work for you
 
Raybiztech Guide To Backbone Javascript Library
Raybiztech Guide To Backbone Javascript LibraryRaybiztech Guide To Backbone Javascript Library
Raybiztech Guide To Backbone Javascript Library
 
Rails on Oracle 2011
Rails on Oracle 2011Rails on Oracle 2011
Rails on Oracle 2011
 
Using Ruby on Rails with legacy Oracle databases
Using Ruby on Rails with legacy Oracle databasesUsing Ruby on Rails with legacy Oracle databases
Using Ruby on Rails with legacy Oracle databases
 

Recently uploaded

Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
Joaquim Jorge
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
panagenda
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 

Recently uploaded (20)

A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 

Sru& and lucene

  • 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
  • 5. serverInfo Generated Automatically – host – port – database
  • 6. databaseInfo From SRWDatabase.props – databaseInfo.title – databaseInfo.description – databaseInfo.contact Provided Automatically – implementation
  • 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)
  • 9. schemaInfo Generated Automatically – LuceneDocument From SRWDatabase.props – xmlSchemas=<list of name> – <schemaName>.identifier= – <schemaName>.location= – <schemaName>.namespace= – <schemaName>.title= – [<schemaName>.transformer=] – [<schemaName>.resolver=]
  • 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
  • 12. configInfo Generated Automatically – maximumRecords (20) – numberOfRecords (10) – resultSetTTL (300) From SRWDatabase.props – configInfo.maximumRecords – configInfo.numberOfRecords – configInfo.resultSetTTL
  • 13. CQL Query Grammar Builtin: BasicLuceneQueryTranslator CqlQueryTranslator – Query makeQuery(CQLNode cn); – Term getTerm(); From SRWDatabase.props – SRWLuceneDatabase. CqlToLuceneQueryTranslator= <ClassName>
  • 14. Persistent Result Sets Builtin: LuceneQueryResult
  • 15. XML Database Records Builtin: BasicLuceneRecordResolver RecordResolver – Void init(Properties props); – Record resolve(Document doc, String IdFieldName, ExtraDataType extraDataType) From SRWDatabase.props – <schemaName>.resolver=<ClassName> – SRWLuceneDatabase.idFieldName= <FieldName>
  • 16. Index Browses Builtin: SRWLuceneDatabase.getTerms()
  • 17. Stylesheets From SRWDatabase.props – explainStyleSheet= /SRW/explainResponse.xsl – scanStyleSheet=/SRW/scanResponse.xsl – searchStyleSheet= /SRW/searchRetrieveResponse.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
  • 19. Sample SRWServer.props db.LuceneDemoDB.class= ORG.oclc.os.SRW.Lucene.SRWLuceneDa tabase db.LuceneDemoDB.home= f:/lucene-2.0.0 db.LuceneDemoDB.configuration= SRWDatabase.props
  • 20. Sample SRWDatabase.props databaseInfo.title=Lucene Demo Database databaseInfo.description=An index of the source code for Lucene databaseInfo.contact=Ralph LeVan (levan@oclc.org) qualifier.cql.serverChoice=contents explainStyleSheet=/SRWLucene/explainResponse.xsl scanStyleSheet=/SRWLucene/scanResponse.xsl searchStyleSheet= /SRWLucene/searchRetrieveResponse.xsl
  • 21. Resources http://www.oclc.org/research/software/srw http:// staff.oclc.org/~levan/SRWLuceneSource.jar http://staff.oclc.org/~levan/SRWLucene.war http://staff.oclc.org/~levan/Implementing%20an%2 http://staff.oclc.org/~levan/SRU%20and%20Lucene http://alcme.oclc.org/srw/SRUServerTester.html