1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
|
<html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>2.Searching the OAI database by web service</title><meta name="generator" content="DocBook XSL Stylesheets Vsnapshot"><link rel="home" href="index.html" title="Zebra - User's Guide and Reference"><link rel="up" href="tutorial.html" title="Chapter3.Tutorial"><link rel="prev" href="tutorial.html" title="Chapter3.Tutorial"><link rel="next" href="tutorial-oai-sru-present.html" title="3.Presenting search results in different formats"></head><body><link rel="stylesheet" type="text/css" href="common/style1.css"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">2.Searching the <acronym class="acronym">OAI</acronym> database by web service</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="tutorial.html">Prev</a></td><th width="60%" align="center">Chapter3.Tutorial</th><td width="20%" align="right"><a accesskey="n" href="tutorial-oai-sru-present.html">Next</a></td></tr></table><hr></div><div class="sect1"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="tutorial-oai-sru-pqf"></a>2.Searching the <acronym class="acronym">OAI</acronym> database by web service</h2></div></div></div><p>
<span class="application">Zebra</span> has a build-in web service, which is close to the
<acronym class="acronym">SRU</acronym> standard web service. We use it to access our new
database using any <acronym class="acronym">XML</acronym> enabled web browser.
This service is using the <acronym class="acronym">PQF</acronym> query language.
In a later
section we show how to run a fully compliant <acronym class="acronym">SRU</acronym> server,
including support for the query language <acronym class="acronym">CQL</acronym>
</p><p>
Searching and retrieving <acronym class="acronym">XML</acronym> records is easy. For example,
you can point your browser to one of the following URLs to
search for the term <code class="literal">the</code>. Just point your
browser at this link:
<a class="ulink" href="http://localhost:9999/?version=1.1&operation=searchRetrieve&x-pquery=the" target="_top">
http://localhost:9999/?version=1.1&operation=searchRetrieve&x-pquery=the</a>
</p><div class="warning" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Warning</h3><p>
These URLs won't work unless you have indexed the example data
and started an <span class="application">Zebra</span> server as outlined in the previous section.
</p></div><p>
In case we actually want to retrieve one record, we need to alter
our URL to the following
<a class="ulink" href="http://localhost:9999/?version=1.1&operation=searchRetrieve&x-pquery=the&startRecord=1&maximumRecords=1&recordSchema=dc" target="_top">
http://localhost:9999/?version=1.1&operation=searchRetrieve&x-pquery=the&startRecord=1&maximumRecords=1&recordSchema=dc
</a>
</p><p>
This way we can page through our result set in chunks of records,
for example, we access the 6th to the 10th record using the URL
<a class="ulink" href="http://localhost:9999/?version=1.1&operation=searchRetrieve&x-pquery=the&startRecord=6&maximumRecords=5&recordSchema=dc" target="_top">
http://localhost:9999/?version=1.1&operation=searchRetrieve&x-pquery=the&startRecord=6&maximumRecords=5&recordSchema=dc
</a>
</p></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="tutorial.html">Prev</a></td><td width="20%" align="center"><a accesskey="u" href="tutorial.html">Up</a></td><td width="40%" align="right"><a accesskey="n" href="tutorial-oai-sru-present.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Chapter3.Tutorial</td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top">3.Presenting search results in different formats</td></tr></table></div></body></html>
|