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 32 33 34 35 36 37 38 39 40 41
|
<html><head><meta charset="ISO-8859-1"><title>2.Queries</title><meta name="generator" content="DocBook XSL Stylesheets Vsnapshot"><link rel="home" href="index.html" title="YAZ User's Guide and Reference"><link rel="up" href="zoom.html" title="Chapter3.ZOOM"><link rel="prev" href="zoom.html" title="Chapter3.ZOOM"><link rel="next" href="zoom.resultsets.html" title="3.Result sets"></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.Queries</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="zoom.html">Prev</a></td><th width="60%" align="center">Chapter3.ZOOM</th><td width="20%" align="right"><a accesskey="n" href="zoom.resultsets.html">Next</a></td></tr></table><hr></div><div class="sect1"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="zoom.query"></a>2.Queries</h2></div></div></div><p>
Query objects represents queries.
</p><pre class="synopsis">
ZOOM_query ZOOM_query_create(void);
void ZOOM_query_destroy(ZOOM_query q);
int ZOOM_query_prefix(ZOOM_query q, const char *str);
int ZOOM_query_cql(ZOOM_query s, const char *str);
int ZOOM_query_sortby(ZOOM_query q, const char *criteria);
int ZOOM_query_sortby2(ZOOM_query q, const char *strategy,
const char *criteria);
</pre><p>
Create query objects using <code class="function">ZOOM_query_create</code>
and destroy them by calling <code class="function">ZOOM_query_destroy</code>.
RPN-queries can be specified in <a class="link" href="tools.html#PQF" title="1.1.Prefix Query Format">PQF</a>
notation by using the
function <code class="function">ZOOM_query_prefix</code>.
The <code class="function">ZOOM_query_cql</code> specifies a CQL
query to be sent to the server/target.
More query types will be added in future versions of YAZ, such as
<a class="link" href="tools.html#CCL" title="1.2.CCL">CCL</a> to RPN-mapping, native CCL query,
etc. In addition to a search, a sort criteria may be set. Function
<code class="function">ZOOM_query_sortby</code> enables Z39.50 sorting and
it takes sort criteria using the same string notation as
yaz-client's <a class="link" href="yaz-client.html#sortspec">sort command</a>.
</p><p><a name="zoom.query.sortby2"></a>
<code class="function">ZOOM_query_sortby2</code> is similar to
<code class="function">ZOOM_query_sortby</code> but allows a strategy for
sorting. The reason for the strategy parameter is that some
protocols offer multiple ways of performing sorting.
For example, Z39.50 has the standard sort, which is performed after
search on an existing result set.
It's also possible to use CQL in Z39.50 as the query type and use
CQL's SORTBY keyword. Finally, Index Data's
Zebra server also allows sorting to be specified as part of RPN (Type 7).
</p><div class="table"><a name="zoom-sort-strategy"></a><p class="title"><b>Table3.2.ZOOM sort strategy</b></p><div class="table-contents"><table class="table" summary="ZOOM sort strategy" border="1"><colgroup><col class="name"><col class="description"></colgroup><thead><tr><th>Name</th><th>Description</th></tr></thead><tbody><tr><td>z39.50</td><td>Z39.50 resultset sort</td></tr><tr><td>type7</td><td>Sorting embedded in RPN(Type-7)</td></tr><tr><td>cql</td><td>CQL SORTBY</td></tr><tr><td>sru11</td><td>SRU sortKeys parameter</td></tr><tr><td>solr</td><td>Solr sort</td></tr><tr><td>embed</td><td>type7 for Z39.50, cql for SRU,
solr for Solr protocol</td></tr></tbody></table></div></div><br class="table-break"></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="zoom.html">Prev</a></td><td width="20%" align="center"><a accesskey="u" href="zoom.html">Up</a></td><td width="40%" align="right"><a accesskey="n" href="zoom.resultsets.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Chapter3.ZOOM</td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top">3.Result sets</td></tr></table></div></body></html>
|