Clarify sort-specification syntax.
[yaz-moved-to-github.git] / doc / yaz-client-commands.xml
1 <!-- 
2    $Id: yaz-client-commands.xml,v 1.11 2005-11-04 17:15:30 mike Exp $
3    Commands for YAZ client.
4    Included in both manual and man page for yaz-client.
5 -->
6 <variablelist>
7  <varlistentry id="command-open"><term>
8    <literal>open </literal><replaceable>zurl</replaceable>
9   </term>
10   <listitem>
11    <para>Opens a connection to a server. The syntax for
12     <replaceable>zurl</replaceable> is the same as described
13     above for connecting from the command line.
14    </para>
15    <para>
16     Syntax:
17    </para>
18    <para>
19     [<literal>(tcp|ssl|unix|http)':'</literal>]<replaceable>host</replaceable>
20     [:<replaceable>port</replaceable>][/<replaceable>base</replaceable>]
21    </para>
22   </listitem>
23  </varlistentry>
24  <varlistentry><term>
25    <literal>quit</literal>
26   </term>
27   <listitem>
28    <para>Quits YAZ client</para>
29   </listitem>
30  </varlistentry>
31  <varlistentry id="command-find"><term>
32    <literal>find </literal><replaceable>query</replaceable></term>
33   <listitem>
34    <para>Sends a Search Request using the <replaceable>query</replaceable>
35     given. By default the query is assumed to be PQF. See command
36     <link linkend="command-querytype"><literal>querytype</literal></link>.
37    </para>
38   </listitem>
39  </varlistentry>
40  <varlistentry><term>
41    <literal>delete</literal> <replaceable>setname</replaceable></term>
42   <listitem>
43    <para>Deletes result set with name <replaceable>setname</replaceable>
44     on the server.</para>
45   </listitem>
46  </varlistentry>
47  <varlistentry><term>
48    <literal>base </literal><replaceable>base1</replaceable>
49    <replaceable>base2</replaceable> ...
50   </term>
51   <listitem>
52    <para>Sets the name(s) of the database(s) to search. One or more
53     databases may be specified separated by blanks. This commands overrides
54     the database given in <replaceable>zurl</replaceable>.
55    </para>
56   </listitem>
57  </varlistentry>
58  <varlistentry><term>
59    <literal>show </literal>
60    [<replaceable>start</replaceable>[+<replaceable>number</replaceable>]]
61   </term>
62   <listitem>
63    <para>Fetches records by sending a Present Request from the start
64     position given by
65     <replaceable>start</replaceable>
66     a number of records given by <replaceable>number</replaceable>. If
67     <replaceable>start</replaceable> is not given, then the client
68     will fetch from position of the last retrieved record plus 1. If
69     <replaceable>number</replaceable> is not given, then one record will
70     be fetched at a time.
71    </para>
72   </listitem>
73  </varlistentry>
74  <varlistentry><term>
75    <literal>scan</literal> <replaceable>term</replaceable>
76   </term>
77   <listitem>
78    <simpara>Scans
79     database index for a term. The syntax resembles the syntax
80     for <link linkend="command-find"><literal>find</literal></link>.
81     If you want to scan for the word <literal>water</literal> you could
82     write
83    </simpara>
84    <screen>
85     scan water
86    </screen>
87    <simpara>
88     but if you want to scan only in, say the title field, you would write
89    </simpara>
90    <screen>
91     scan @attr 1=4 water
92    </screen>
93   </listitem>
94  </varlistentry>
95  <varlistentry><term>
96    <literal>scanpos</literal> <replaceable>pos</replaceable>
97   </term>
98   <listitem>
99    <simpara>
100     Sets preferred position for scan. This value
101     is used in next scan. By default position is 1.
102    </simpara>
103   </listitem>
104  </varlistentry>
105  <varlistentry><term>
106    <literal>scansize</literal> <replaceable>size</replaceable>
107   </term>
108   <listitem>
109    <simpara>
110     Sets number of entries to be returned by scan. Default
111     number of entries is 20.
112    </simpara>
113   </listitem>
114  </varlistentry>
115  <varlistentry><term>
116    <literal>scanstep</literal> <replaceable>step</replaceable>
117   </term>
118   <listitem>
119    <simpara>
120     Set step-size for scan. This value is used in next scan
121     sent to the target. By default step-size is 0.
122    </simpara>
123   </listitem>
124  </varlistentry>
125  <varlistentry id="sortspec"><term>
126    <literal>sort</literal> <replaceable>sortspecs</replaceable>
127   </term>
128   <listitem>
129    <para>Sorts a result set. The sort command takes a
130     sequence of space-separated sort specifications, with each sort
131     specification consisting of two space-separated words (so that the
132     whole specification list is made up of an even number of words).
133     The first word of each specification
134     holds a field (sort criterion) and the second holds flags.
135     If the sort criterion includes <literal>=</literal> it is assumed
136     that the <literal>SortKey</literal> is of type
137     <literal>sortAttributes</literal> using Bib-1: in this case
138     the integer before <literal>=</literal> is
139     the attribute type and the integer following <literal>=</literal>
140     is the attribute value.
141     If no <literal>=</literal> is in the criterion it is treated as a
142     sortfield of type InternationalString.
143     The flags word of each sort specification must consist of
144     <literal>s</literal> 
145     for case sensitive or <literal>i</literal> for case insensitive, and
146     <literal>&lt;</literal> for ascending order or <literal>&gt;</literal>
147     for descending order.
148    </para>
149   </listitem>
150  </varlistentry>
151  <varlistentry><term>
152    <literal>sort+</literal>
153   </term>
154   <listitem>
155    <para>Same as <literal>sort</literal> but stores the sorted
156     result set in a new result set.
157    </para>
158   </listitem>
159  </varlistentry>
160  <varlistentry><term>
161    <literal>authentication</literal> <replaceable>openauth</replaceable>
162   </term>
163   <listitem>
164    <para>Sets up a authentication string if a server requires
165     authentication (v2 OpenStyle). The authentication string is first
166     sent to the server when the 
167     <link linkend="command-open"><literal>open</literal></link> command is
168     issued and the Z39.50 Initialize Request is sent, so this command
169     must be used before <literal>open</literal> in order to be effective.
170     A common convention for the <replaceable>authopen</replaceable> string
171     is that the username - and password is separated by a slash, e.g.
172     <literal>myusername/mysecret</literal>.
173    </para>
174   </listitem>
175  </varlistentry>
176
177  <varlistentry><term>
178    <literal>list_all</literal>
179   </term>
180   <listitem>
181    <para>This command displays status and values for many settings.
182    </para>
183   </listitem>
184  </varlistentry>
185  
186  <varlistentry><term>
187    <literal>lslb</literal> <replaceable>n</replaceable>
188   </term>
189   <listitem>
190    <para>Sets the limit for when no records should be returned
191     together with the search result.
192     See the
193     <ulink
194            url="http://lcweb.loc.gov/z3950/agency/markup/04.html#3.2.2.1.6">
195      Z39.50 standard
196     </ulink>
197     for more details.
198    </para>
199   </listitem>
200  </varlistentry>
201
202  <varlistentry><term>
203    <literal>ssub</literal> <replaceable>n</replaceable>
204   </term>
205   <listitem>
206    <para>Sets the limit for when all records should be returned with
207     the search result.
208     See the
209     <ulink
210            url="http://lcweb.loc.gov/z3950/agency/markup/04.html#3.2.2.1.6">
211      Z39.50 standard
212     </ulink> for more details.
213    </para>
214   </listitem>
215  </varlistentry>
216  
217  <varlistentry><term>
218    <literal>mspn</literal> <replaceable>n</replaceable>
219   </term>
220   <listitem>
221    <para>Sets the number of records should be returned if the
222     number of records in the result set is between the values of
223     <literal>lslb</literal> and <literal>ssub</literal>.
224     See the
225     <ulink
226            url="http://lcweb.loc.gov/z3950/agency/markup/04.html#3.2.2.1.6">
227      Z39.50 standard
228     </ulink>
229     for more details.
230    </para>
231   </listitem>
232  </varlistentry>
233  <varlistentry><term>
234    <literal>status</literal>
235   </term>
236   <listitem>
237    <para>Displays the values of <literal>lslb</literal>,
238     <literal>ssub</literal> and <literal>mspn</literal>.
239    </para>
240   </listitem>
241  </varlistentry>
242  <varlistentry><term>
243    <literal>setname</literal>
244   </term>
245   <listitem>
246    <para>Switches named result sets on and off. Default is on.
247    </para>
248   </listitem>
249  </varlistentry>
250  <varlistentry><term>
251    <literal>cancel</literal>
252   </term>
253   <listitem>
254    <para>Sends a Trigger Resource Control Request to the target.
255    </para>
256   </listitem>
257  </varlistentry>
258  <varlistentry><term>
259    <literal>format</literal> <replaceable>oid</replaceable>
260   </term>
261   <listitem>
262    <para>Sets the preferred transfer syntax for retrieved records.
263     yaz-client supports all the record syntaxes that currently
264     are registered. See
265     <ulink
266            url="http://lcweb.loc.gov/z3950/agency/defns/oids.html#5">
267      Z39.50 Standard
268     </ulink>
269     for more details. Commonly used records syntaxes include usmarc,
270     sutrs, grs1 and xml.
271    </para>
272   </listitem>
273  </varlistentry>
274  <varlistentry><term>
275    <literal>elements</literal> <replaceable>e</replaceable>
276   </term>
277   <listitem>
278    <para>Sets the element set name for the records. Many targets support
279     element sets are B (for brief) and F (for full).
280    </para>
281   </listitem>
282  </varlistentry>
283  <varlistentry><term>
284    <literal>close</literal>
285   </term>
286   <listitem>
287    <para>Sends a Z39.50 Close APDU and closes connection with the peer
288    </para>
289   </listitem>
290  </varlistentry>
291  <varlistentry id="command-querytype"><term>
292    <literal>querytype</literal> <replaceable>type</replaceable>
293   </term>
294   <listitem>
295    <para>Sets the query type as used by command 
296    <link linkend="command-find"><literal>find</literal></link>.
297     The following is supported:
298     <literal>prefix</literal> for
299         <link linkend="PQF">Prefix Query Notation</link> (Type-1 Query);
300     <literal>ccl</literal> for CCL search (Type-2 Query),
301     <literal>cql</literal> for CQL (Type-104 search with CQL OID),
302     <literal>ccl2rpn</literal> for
303         <link linkend="CCL">CCL</link> to RPN conversion (Type-1 Query).
304     <literal>cql2rpn</literal> for
305         CQL to RPN conversion (Type-1 Query).
306    </para>
307   </listitem>
308  </varlistentry>
309  <varlistentry><term>
310    <literal>attributeset</literal> <replaceable>set</replaceable>
311   </term>
312   <listitem>
313    <para>
314     Sets attribute set OID for prefix queries (RPN, Type-1).
315    </para>
316   </listitem>
317  </varlistentry>
318  <varlistentry><term>
319    <literal>refid</literal> <replaceable>id</replaceable>
320   </term>
321   <listitem>
322    <para>Sets reference ID for Z39.50 Request(s).
323    </para>
324   </listitem>
325  </varlistentry>
326  <varlistentry><term>
327    <literal>itemorder</literal>
328    <replaceable>type</replaceable> <replaceable>no</replaceable>
329   </term>
330   <listitem>
331    <para>Sends an Item Order Request using the ILL External. 
332     <replaceable>type</replaceable> is either 1 or 2 which corresponds to
333     ILL-Profile 1 and 2 respectively. The <replaceable>no</replaceable>
334     is the Result Set position of the record to be ordered.
335    </para>
336   </listitem>
337  </varlistentry>
338  <varlistentry><term>
339    <literal>update</literal>
340    <replaceable>action</replaceable>
341    <replaceable>recid</replaceable>
342    <replaceable>doc</replaceable>
343   </term>
344   <listitem>
345    <para>Sends Item Update Request. The <replaceable>action</replaceable>
346     argument must be the action type: one of <literal>insert</literal>,
347     <literal>replace</literal>, <literal>delete</literal> and
348     <literal>update</literal>. The second argument, 
349     <replaceable>recid</replaceable>, is the
350     record identifier (any string). Third argument which is optional is
351     the record document for the request. If doc is a quoted string
352     (double quotes) the string content is used verbatim. If doc is not
353     a quoted string, it is assumed to be a filename which is read, then
354     sent as the docuemnt content. If doc is omitted, the last received
355     record (as parf of present response or piggybacked search response) 
356     is used for the update.
357    </para>
358   </listitem>
359  </varlistentry>
360
361  <varlistentry><term>
362    <literal>.</literal>
363    <replaceable>filename</replaceable>
364   </term>
365   <listitem>
366    <para>Executes list of commands from
367     file <replaceable>filename</replaceable>, just like source on
368     most UNIX shells.
369    </para>
370   </listitem>
371  </varlistentry>
372
373  <varlistentry><term>
374    <literal>!</literal>
375    <replaceable>args</replaceable>
376   </term>
377   <listitem>
378    <para>Executes command <replaceable>args</replaceable> in subshell
379     using the <literal>system</literal> call.
380    </para>
381   </listitem>
382  </varlistentry>
383
384  <varlistentry><term>
385    <literal>push_command</literal>
386    <replaceable>command</replaceable>
387   </term>
388   <listitem>
389    <para>The push_command takes another command as its argument.
390     That command is then added to the history information (so
391     you can retrieve it later). The command itself is not
392     executed. This command only works if you have GNU readline/history
393     enabled.
394    </para>
395   </listitem>
396  </varlistentry>
397
398  <varlistentry><term>
399    <literal>set_apdufile</literal>
400    <replaceable>filename</replaceable>
401   </term>
402   <listitem>
403    <para>Sets that APDU should be logged to file
404     <replaceable>filename</replaceable>. Another way to achieve
405     APDU log is by using command-line option <literal>-a</literal>.
406    </para>
407   </listitem>
408  </varlistentry>
409
410  <varlistentry><term>
411    <literal>set_auto_reconnect</literal>
412    <replaceable>flag</replaceable>
413   </term>
414   <listitem>
415    <para>Specifies whether YAZ client automatically reconnect if
416     target closes connection (Z39.50 only).
417    </para>
418    <para>
419     <replaceable>flag</replaceable> must be either
420     <literal>on</literal> or <literal>off</literal>.
421    </para>
422   </listitem>
423  </varlistentry>
424
425  <varlistentry id="command-set-auto-wait"><term>
426    <literal>set_auto_wait</literal>
427    <replaceable>flag</replaceable>
428   </term>
429   <listitem>
430    <para>Specifies whether YAZ client should wait for
431    response protocol packages after a request.
432    By default YAZ client waits (on) for response packages immediately
433    after a command (find, show) has been issued. If <literal>off</literal>
434    is used, YAZ client does not attempt to receive packages automatically.
435    These will have to be manually received when command 
436    <link linkend="command-wait-response">
437     <literal>wait_response</literal>
438    </link> is used.
439    </para>
440    <para>
441    <replaceable>flag</replaceable> must be either
442    <literal>on</literal> or <literal>off</literal>.
443    </para>
444   </listitem>
445  </varlistentry>
446
447  <varlistentry><term>
448    <literal>set_marcdump</literal>
449    <replaceable>filename</replaceable>
450   </term>
451   <listitem>
452    <para>Specifies that all retrieved records should be appended to
453     file <replaceable>filename</replaceable>. This command does the
454     thing as option <literal>-m</literal>.
455    </para>
456   </listitem>
457  </varlistentry>
458
459  <varlistentry><term>
460    <literal>schema</literal>
461    <replaceable>schemaid</replaceable>
462   </term>
463   <listitem>
464    <para>Specifies schema for retrieval.
465     Schema may be specified as an OID for Z39.50.
466     For SRW, schema is a simple string URI.
467    </para>
468   </listitem>
469  </varlistentry>
470
471  <varlistentry id="command-charset"><term>
472    <literal>charset</literal>
473    <replaceable>negotiationcharset</replaceable>
474    [<replaceable>displaycharset</replaceable>]
475    [[<replaceable>marccharset</replaceable>]]
476   </term>
477   <listitem>
478    <para>Specifies character set (encoding) for Z39.50
479     negotiation / SRW encoding and/or character set for output (terminal).
480    </para>
481    <para>
482     <replaceable>negotiationcharset</replaceable> is the name
483     of the character set to be negotiated by the server. The special name
484     <literal>-</literal> for <replaceable>negotiationcharset</replaceable>
485     specifies <emphasis>no</emphasis> character set to be negotiated.
486    </para>
487    <para>
488     If <replaceable>displaycharset</replaceable> is given, it specifies name
489     of the character set of the output (on the terminal on which
490     YAZ client is running). To disable conversion of characters
491     to the output encoding, the special name <literal>-</literal> (dash)
492     can be used.
493     If the special name <literal>auto</literal> is given, YAZ client will
494     convert strings to the encoding of the
495     terminal as returned by <function>nl_langinfo</function> call.
496    </para>
497    <para>
498     If <replaceable>marcharset</replaceable> is given, it specifies name
499     of the character set of retrieved MARC records from server. See
500     also <literal>marcharset</literal> command.
501    </para>
502    <note>
503     <para>
504      Since character set negotation takes effect in the Z39.50
505      Initialize Request you should issue this command before
506      command <link linkend="command-open"><literal>open</literal></link>
507      is used.
508     </para>
509    </note>
510    <note>
511     <para>
512      MARC records are not covered by Z39.50 character set negotiation,
513      so that's why there is a separate character that must be known
514      in order to do meaningful converson(s).
515     </para>
516    </note>
517   </listitem>
518  </varlistentry>
519
520  <varlistentry><term>
521    <literal>negcharset</literal>
522    <replaceable>charset</replaceable>
523   </term>
524   <listitem>
525    <para>Specifies character set for negotiation (Z39.50). The
526     argument is the same as second argument for command
527     <link linkend="command-charset"><literal>charset</literal></link>.
528    </para>
529   </listitem>
530  </varlistentry>
531
532  <varlistentry><term>
533    <literal>displaycharset</literal>
534    <replaceable>charset</replaceable>
535   </term>
536   <listitem>
537    <para>Specifies character set for output (display). The
538     argument is the same as second argument for command 
539     <link linkend="command-charset"><literal>charset</literal></link>.
540    </para>
541   </listitem>
542  </varlistentry>
543
544  <varlistentry><term>
545    <literal>marccharset</literal>
546    <replaceable>charset</replaceable>
547   </term>
548   <listitem>
549    <para>Specifies character set for retrieved MARC records so
550     that YAZ client can display them in a character suitable
551     for your display. See <literal>charset</literal> command.
552     If <literal>auto</literal> is given, YAZ will assume
553     that MARC21/USMARC is using MARC8/UTF8 and ISO-8859-1
554     for all other MARC variants. The charset argument is the
555     same as third argument for command
556     <link linkend="command-charset"><literal>charset</literal></link>.
557    </para>
558   </listitem>
559  </varlistentry>
560
561  <varlistentry><term>
562    <literal>set_cclfile</literal>
563    <replaceable>filename</replaceable>
564   </term>
565   <listitem>
566    <para>Specifies that CCL fields should be read from file
567     file <replaceable>filename</replaceable>. This command does the
568     thing as option <literal>-c</literal>.
569    </para>
570   </listitem>
571  </varlistentry>
572
573  <varlistentry><term>
574    <literal>set_cqlfile</literal>
575    <replaceable>filename</replaceable>
576   </term>
577   <listitem>
578    <para>Specifies that CQL fields should be read from file
579     file <replaceable>filename</replaceable>. This command does the
580     thing as option <literal>-q</literal>.
581    </para>
582   </listitem>
583  </varlistentry>
584
585  <varlistentry><term>
586    <literal>register_oid</literal>
587    <replaceable>name</replaceable>
588    <replaceable>class</replaceable>
589    <replaceable>OID</replaceable>
590   </term>
591   <listitem>
592    <para>This command allows you to register your own object
593     identifier - so that instead of entering a long dot-notation
594     you can use a short name instead.
595     The <replaceable>name</replaceable> is your
596     name for the OID, <replaceable>class</replaceable> is the
597     class, and <replaceable>OID</replaceable> is the raw OID in
598     dot notation. Class is one <literal>appctx</literal>,
599     <literal>absyn</literal>, <literal>attet</literal>,
600     <literal>transyn</literal>, <literal>diagset</literal>,
601     <literal>recsyn</literal>, <literal>resform</literal>,
602     <literal>accform</literal>, <literal>extserv</literal>,
603     <literal>userinfo</literal>, <literal>elemspec</literal>,
604     <literal>varset</literal>, <literal>schema</literal>,
605     <literal>tagset</literal>, <literal>general</literal>.
606     If you're in doubt use the <literal>general</literal>
607     class.
608    </para>
609   </listitem>
610  </varlistentry>
611
612  <varlistentry><term>
613    <literal>register_tab</literal>
614    <replaceable>command</replaceable>
615    <replaceable>string</replaceable>
616   </term>
617   <listitem>
618    <para>This command registers a TAB completion string for
619     the command given.
620    </para>
621   </listitem>
622  </varlistentry>
623
624  <varlistentry><term>
625    <literal>sleep</literal>
626    <replaceable>seconds</replaceable>
627   </term>
628   <listitem>
629    <para>This command makes YAZ client sleep (be idle) for
630     the number of seconds given.
631    </para>
632   </listitem>
633  </varlistentry>
634
635  <varlistentry id="command-wait-response"><term>
636    <literal>wait_response</literal>
637    [ <replaceable>number</replaceable>]
638   </term>
639   <listitem>
640    <para>This command makes YAZ client wait for a number of
641     response packages from target. If <replaceable>number</replaceable> is
642     omitted, 1 is assumed. 
643    </para>
644    <para>This command is rarely used and is only useful if command
645     <link linkend="command-set-auto-wait">
646      <literal>set_auto_wait</literal>
647     </link> is set to off.
648    </para>
649   </listitem>
650  </varlistentry>
651
652  <varlistentry id="command-xmles"><term>
653    <literal>xmles</literal>
654    <replaceable>OID</replaceable>
655    <replaceable>doc</replaceable>
656   </term>
657   <listitem>
658    <para>Sends XML Extended Services request using the OID and doc given.
659    </para>
660   </listitem>
661  </varlistentry>
662
663  <varlistentry><term>
664    <literal>zversion</literal>
665    <replaceable>ver</replaceable>
666   </term>
667   <listitem>
668    <para>This command sets Z39.50 version for negotiation. 
669     Should be used before 
670     <link linkend="command-open"><literal>open</literal></link>.
671     By default 3 (version 3) is used.
672    </para>
673   </listitem>
674  </varlistentry>
675
676  <varlistentry><term>
677    <literal>options</literal>
678    <replaceable>op1 op2..</replaceable>
679   </term>
680   <listitem>
681    <para>This command sets Z39.50 options for negotiation. 
682     Should be used before 
683    <link linkend="command-open"><literal>open</literal></link>.
684    </para>
685    <para>
686     The following options are supported:
687     <literal>search</literal>,  
688     <literal>present</literal>,  
689     <literal>delSet</literal>,  
690     <literal>resourceReport</literal>,  
691     <literal>triggerResourceCtrl</literal>,  
692     <literal>resourceCtrl</literal>,  
693     <literal>accessCtrl</literal>,  
694     <literal>scan</literal>,  
695     <literal>sort</literal>,  
696     <literal>extendedServices</literal>,  
697     <literal>level_1Segmentation</literal>,  
698     <literal>level_2Segmentation</literal>,  
699     <literal>concurrentOperations</literal>,  
700     <literal>namedResultSets</literal>,  
701     <literal>encapsulation</literal>,  
702     <literal>resultCount</literal>,  
703     <literal>negotiationModel</literal>,  
704     <literal>duplicationDetection</literal>,  
705     <literal>queryType104</literal>,  
706     <literal>pQESCorrection</literal>,  
707     <literal>stringSchema</literal>.
708    </para>
709   </listitem>
710  </varlistentry>
711  
712 </variablelist>
713 <!-- Keep this comment at the end of the file
714 Local variables:
715 mode: sgml
716 sgml-omittag:t
717 sgml-shorttag:t
718 sgml-minimize-attributes:nil
719 sgml-always-quote-attributes:t
720 sgml-indent-step:1
721 sgml-indent-data:t
722 sgml-parent-document: "yaz.xml"
723 sgml-local-catalogs: nil
724 sgml-namecase-general:t
725 End:
726 -->