1 <!-- $Id: client.xml,v 1.15 2003-05-19 20:45:07 adam Exp $ -->
2 <chapter id="client"><title>The YAZ client</title>
3 <sect1 id="client.introduction"><title>Introduction</title>
5 yaz-client is a line-mode Z39.50/SRW client. It supports a fair amount
6 of the functionality of the Z39.50v3 standard.
7 Its primary purpose is to exercise the package, and verify that
9 For the same reason some commands offers more functionality than others.
10 Commands that exercises common Z39.50 services such as search and present
11 have more features than less common supported services, such as Extended
12 Services (ItemOrder, ItemUpdate,..).
15 <sect1 id="client.invoking"><title>Invoking the YAZ client</title>
17 It can be started by typing
20 <command>yaz-client</command>
21 <arg>-m <replaceable>fname</replaceable></arg>
22 <arg>-a <replaceable>fname</replaceable></arg>
23 <arg>-c <replaceable>fname</replaceable></arg>
24 <arg>-v <replaceable>level</replaceable></arg>
25 <arg>-p <replaceable>target</replaceable></arg>
26 <arg>-u <replaceable>auth</replaceable></arg>
27 <arg>-k <replaceable>size</replaceable></arg>
32 in a UNIX shell / WIN32 console. The <replaceable>zurl</replaceable>,
33 specifies a Z39.50/SRW host and, if specified, the client first tries to
34 establish connection with the Z39.50/SRW target.
37 Options are prefixed by <literal>-</literal> followed by a
41 The following options are supported:
45 <literal>-m</literal> <replaceable>fname</replaceable>
47 <simpara>All retrieved transfer records are appended to file
48 <replaceable>fname</replaceable>. All records as returned by a
49 target(s) in Search Responses and Present Responses are appended
54 <literal>-a</literal> <replaceable>fname</replaceable>
56 <simpara>Pretty-print log of APDUs sent and received is appended
57 to the file <replaceable>fname</replaceable>.
58 If <replaceable>fname</replaceable> is <literal>-</literal> (minus)
59 the APDU log is written to <literal>stderr</literal>.
63 <literal>-c</literal> <replaceable>fname</replaceable>
65 <simpara>Sets the filename for CCL fields to
66 <replaceable>fname</replaceable>. If this option is not given the
67 YAZ client reads CCL fields from file <literal>default.bib</literal>.
71 <literal>-v</literal> <replaceable>level</replaceable>
73 <simpara>Sets the LOG level to <replaceable>level</replaceable>.
74 Level is a sequence of tokens separated by comma. Each token
75 is a integer or a named LOG item - one of
76 <literal>fatal</literal>,
77 <literal>debug</literal>,
78 <literal>warn</literal>,
79 <literal>log</literal>,
80 <literal>malloc</literal>,
81 <literal>all</literal>,
82 <literal>none</literal>.
86 <literal>-p</literal> <replaceable>target</replaceable>
88 <simpara>Specifies proxy address. When set YAZ client will
89 connect to a proxy on the address and port given.
90 The actual target will be specified as part of the InitRequest
91 to inform the proxy about actual target.
95 <literal>-u</literal> <replaceable>auth</replaceable>
97 <simpara>Specifies authentication. Usually the form
98 <replaceable>user</replaceable>/<replaceable>password</replaceable>
99 is used. This option does the same thing as the
100 <literal>auth</literal> command.
101 </simpara></listitem>
105 <literal>-k</literal> <replaceable>size</replaceable>
107 <simpara>Specifies the maximum messages size in kilobytes.
108 The default maximum message size for the YAZ client is 1024
110 </simpara></listitem>
115 In order to connect to Index Data's test Z39.50 server on
116 <literal>bagel.indexdata.dk</literal>, port 210 and with the
117 database name <literal>marc</literal>, one could type
119 yaz-client bagel.indexdata.dk:210/marc
123 The same server is also a SOAP SRW service. Connect to it via HTTP
126 yaz-client http://bagel.indexdata.dk:210/marc
130 In order to enable APDU log and connect to localhost, port 210 (default)
131 and database Default (default) you'd write:
133 yaz-client -a - localhost
137 The following command connects to a local server via UNIX
138 socket <filename>/tmp/yaz</filename> and sets maximum message size to
141 yaz-client -k 5120 unix:/tmp/yaz
145 <sect1 id="client.commands"><title>Commands</title>
147 When the YAZ client has read options and connected to a target, if given,
148 it will display <literal>Z></literal> and await your command.
149 Commands are executed by hitting the return key.
150 You can always issue the command <literal>?</literal> to see the list
151 of available commands.
154 The commands are (the letters in parenthesis are short
155 names for the commands):
158 &yaz-client-commands;
161 <sect1 id="client.searching"><title>Searching</title>
163 The simplest example of a Prefix Query would be something like
171 In those queries no attributes was specified.
172 This leaves it up to the server what fields to search but
173 most servers will search in all fields. Some servers does not
174 support this feature though, and require that some attributes
175 are defined. To add one attribute you could do:
179 where we search in the title field, since the use(1) is title(4).
180 If we want to search in the author field <emphasis>and</emphasis>
181 in the title field, and in the title field using right truncation
182 it could look something like this:
184 f @and @attr 1=1003 knuth @attr 1=4 @attr 5=1 computer
186 Finally using a mix of Bib-1 and GILS attributes could look
189 f @attrset Bib-1 @and @attr GILS 1=2008 Washington @attr 1=21 weather
191 For the full specification of the Prefix Query see the section
192 <link linkend="PQF">Prefix Query Format</link>.
197 <!-- Keep this comment at the end of the file
202 sgml-minimize-attributes:nil
203 sgml-always-quote-attributes:t
206 sgml-parent-document: "yaz.xml"
207 sgml-local-catalogs: nil
208 sgml-namecase-general:t