Initial commit
[yaz4j-moved-to-github.git] / dependencies / yaz_3.0.14 / doc / zoom.scan.html
1 <html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>5. Scan</title><meta name="generator" content="DocBook XSL Stylesheets V1.73.2"><link rel="start" href="index.html" title="YAZ User's Guide and Reference"><link rel="up" href="zoom.html" title="Chapter 3. ZOOM"><link rel="prev" href="zoom.records.html" title="4. Records"><link rel="next" href="zoom.extendedservices.html" title="6. Extended Services"></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">5. Scan</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="zoom.records.html">Prev</a> </td><th width="60%" align="center">Chapter 3. ZOOM</th><td width="20%" align="right"> <a accesskey="n" href="zoom.extendedservices.html">Next</a></td></tr></table><hr></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="zoom.scan"></a>5. Scan</h2></div></div></div><p>
2     This section describes an interface for Scan. Scan is not an
3     official part of the ZOOM model yet. The result of a scan operation
4     is the <code class="literal">ZOOM_scanset</code> which is a set of terms
5     returned by a target.
6    </p><p>
7     The Scan interface is supported for both Z39.50 and SRU.
8    </p><pre class="synopsis">
9     ZOOM_scanset ZOOM_connection_scan(ZOOM_connection c,
10                                       const char *startpqf);
11
12     ZOOM_scanset ZOOM_connection_scan1(ZOOM_connection c,
13                                        ZOOM_query q);
14
15     size_t ZOOM_scanset_size(ZOOM_scanset scan);
16
17     const char * ZOOM_scanset_term(ZOOM_scanset scan, size_t pos,
18                                    int *occ, size_t *len);
19
20     const char * ZOOM_scanset_display_term(ZOOM_scanset scan, size_t pos,
21                                            int *occ, size_t *len);
22
23     void ZOOM_scanset_destroy (ZOOM_scanset scan);
24
25     const char *ZOOM_scanset_option_get(ZOOM_scanset scan,
26                                          const char *key);
27
28     void ZOOM_scanset_option_set(ZOOM_scanset scan, const char *key,
29                                  const char *val);
30     </pre><p>
31     The scan set is created by function
32     <code class="function">ZOOM_connection_scan</code> which performs a scan
33     operation on the connection using the specified
34     <em class="parameter"><code>startpqf</code></em>.
35     If the operation was successful, the size of the scan set can be
36     retrieved by a call to <code class="function">ZOOM_scanset_size</code>.
37     Like result sets, the items are numbered 0,..size-1.
38     To obtain information about a particular scan term, call function
39     <code class="function">ZOOM_scanset_term</code>. This function takes
40     a scan set offset <code class="literal">pos</code> and returns a pointer
41     to a <span class="emphasis"><em>raw term</em></span> or <code class="literal">NULL</code> if
42     non-present.
43     If present, the <code class="literal">occ</code> and <code class="literal">len</code> 
44     are set to the number of occurrences and the length
45     of the actual term respectively.
46     <code class="function">ZOOM_scanset_display_term</code> is similar to
47     <code class="function">ZOOM_scanset_term</code> except that it returns
48     the <span class="emphasis"><em>display term</em></span> rather than the raw term.
49     In a few cases, the term is different from display term. Always
50     use the display term for display and the raw term for subsequent
51     scan operations (to get more terms, next scan result, etc).
52    </p><p>
53     A scan set may be freed by a call to function
54     <code class="function">ZOOM_scanset_destroy</code>.
55     Functions <code class="function">ZOOM_scanset_option_get</code> and
56     <code class="function">ZOOM_scanset_option_set</code> retrieves and sets
57     an option respectively.
58    </p><p>
59     The <em class="parameter"><code>startpqf</code></em> is a subset of PQF, namely
60     the Attributes+Term part. Multiple <code class="literal">@attr</code> can
61     be used. For example to scan in title (complete) phrases:
62     </p><div class="literallayout"><p><br>
63      @attr 1=4 @attr 6=2 "science o"<br>
64     </p></div><p>
65    </p><p>
66     The <code class="function">ZOOM_connecton_scan1</code> is a newer and
67     more generic alternative to <code class="function">ZOOM_connection_scan</code>
68     which allows to use both CQL and PQF for Scan.
69    </p><div class="table"><a name="zoom.scanset.options"></a><p class="title"><b>Table 3.4. ZOOM Scan Set Options</b></p><div class="table-contents"><table summary="ZOOM Scan Set Options" border="1"><colgroup><col><col><col></colgroup><thead><tr><th>Option</th><th>Description</th><th>Default</th></tr></thead><tbody><tr><td>
70         number</td><td>Number of Scan Terms requested in next scan.
71         After scan it holds the actual number of terms returned.
72        </td><td>10</td></tr><tr><td>
73         position</td><td>Preferred Position of term in response
74         in next scan; actual position after completion of scan.
75        </td><td>1</td></tr><tr><td>
76         stepSize</td><td>Step Size
77        </td><td>0</td></tr><tr><td>
78         scanStatus</td><td>An integer indicating the Scan Status
79         of last scan.
80        </td><td>0</td></tr><tr><td>
81         rpnCharset</td><td>Character set for RPN terms.
82         If this is set, ZOOM C will assume that the ZOOM application is
83         running UTF-8. Terms in RPN queries are then converted to the
84         rpnCharset. If this is unset, ZOOM C will not assume any encoding
85         of RPN terms and no conversion is performed.
86        </td><td>none</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.records.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.extendedservices.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">4. Records </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> 6. Extended Services</td></tr></table></div></body></html>