2 <!-- $Id: server.xml,v 1.7 2002-10-30 11:09:39 adam Exp $ -->
3 <title>The Z39.50 Server</title>
6 <title>Running the Z39.50 Server (zebrasrv)</title>
9 FIXME - We need to be consistent here, zebraidx had the options at the
10 end, and lots of explaining text before them. Same for zebrasvr! -H
11 FIXME - At least we need a small intro, what is zebrasvr, and how it
12 can be run (inetd, nt service, stand-alone program, daemon...) -H
16 <emphasis remap="bf">Syntax</emphasis>
19 zebrasrv [options] [listener-address ...]
25 <emphasis remap="bf">Options</emphasis>
29 <term>-a <replaceable>APDU file</replaceable></term>
32 Specify a file for dumping PDUs (for diagnostic purposes).
33 The special name "-" sends output to <literal>stderr</literal>.
38 <term>-c <replaceable>config-file</replaceable></term>
41 Read configuration information from
42 <replaceable>config-file</replaceable>.
43 The default configuration is <literal>./zebra.cfg</literal>.
51 Don't fork on connection requests. This can be useful for
52 symbolic-level debugging. The server can only accept a single
53 connection in this mode.
61 Use the Z39.50 protocol. Currently the only protocol supported.
62 The option is retained for historical reasons, and for future
68 <term>-l <replaceable>logfile</replaceable></term>
71 Specify an output file for the diagnostic messages.
72 The default is to write this information to <literal>stderr</literal>.
77 <term>-v <replaceable>log-level</replaceable></term>
80 The log level. Use a comma-separated list of members of the set
81 {fatal,debug,warn,log,all,none}.
86 <term>-u <replaceable>username</replaceable></term>
89 Set user ID. Sets the real UID of the server process to that of the
90 given <replaceable>username</replaceable>.
91 It's useful if you aren't comfortable with having the
92 server run as root, but you need to start it as such to bind a
98 <term>-w <replaceable>working-directory</replaceable></term>
101 Change working directory.
109 Run under the Internet superserver, <literal>inetd</literal>.
110 Make sure you use the logfile option <literal>-l</literal> in
111 conjunction with this mode and specify the <literal>-l</literal>
112 option before any other options.
117 <term>-t <replaceable>timeout</replaceable></term>
120 Set the idle session timeout (default 60 minutes).
125 <term>-k <replaceable>kilobytes</replaceable></term>
128 Set the (approximate) maximum size of
129 present response messages. Default is 1024 KB (1 MB).
137 A <replaceable>listener-address</replaceable> consists of an optional
138 transport mode followed by a colon (:) followed by a listener address.
139 The transport mode is either <literal>ssl</literal> or
140 <literal>tcp</literal> (default).
144 For TCP, an address has the form
150 hostname | IP-number [: portnumber]
156 The port number defaults to 210 (standard Z39.50 port) for
157 privileged users (root), and 9999 for normal users.
175 In both cases, the special hostname "@" is mapped to
176 the address INADDR_ANY, which causes the server to listen on any local
177 interface. To start the server listening on the registered port for
178 Z39.50, and to drop root privileges once the ports are bound, execute
179 the server like this (from a root shell):
191 You can replace <literal>daemon</literal> with another user, eg.
192 your own account, or a dedicated IR server account.
196 The default behavior for <literal>zebrasrv</literal> is to establish
197 a single TCP/IP listener, for the Z39.50 protocol, on port 9999.
202 <sect1 id="protocol-support">
203 <title>Z39.50 Protocol Support and Behavior</title>
206 <title>Initialization</title>
209 During initialization, the server will negotiate to version 3 of the
210 Z39.50 protocol, and the option bits for Search, Present, Scan,
211 NamedResultSets, and concurrentOperations will be set, if requested by
212 the client. The maximum PDU size is negotiated down to a maximum of
219 <title>Search</title>
222 FIXME - Need to explain the string tag stuff before people get bogged
223 down with all these attribute numbers. Perhaps in its own
228 The supported query type are 1 and 101. All operators are currently
229 supported with the restriction that only proximity units of type "word"
230 are supported for the proximity operator.
231 Queries can be arbitrarily complex.
232 Named result sets are supported, and result sets can be used as operands
234 Searches may span multiple databases.
238 The server has full support for piggy-backed retrieval (see
239 also the following section).
243 <emphasis>Use</emphasis> attributes are interpreted according to the
244 attribute sets which have been loaded in the
245 <literal>zebra.cfg</literal> file, and are matched against specific
246 fields as specified in the <literal>.abs</literal> file which
247 describes the profile of the records which have been loaded.
248 If no Use attribute is provided, a default of Bib-1 Any is assumed.
252 If a <emphasis>Structure</emphasis> attribute of
253 <emphasis>Phrase</emphasis> is used in conjunction with a
254 <emphasis>Completeness</emphasis> attribute of
255 <emphasis>Complete (Sub)field</emphasis>, the term is matched
256 against the contents of the phrase (long word) register, if one
257 exists for the given <emphasis>Use</emphasis> attribute.
258 A phrase register is created for those fields in the
259 <literal>.abs</literal> file that contains a
260 <literal>p</literal>-specifier.
261 <!-- ### whatever the hell _that_ is -->
265 If <emphasis>Structure</emphasis>=<emphasis>Phrase</emphasis> is
266 used in conjunction with <emphasis>Incomplete Field</emphasis> - the
267 default value for <emphasis>Completeness</emphasis>, the
268 search is directed against the normal word registers, but if the term
269 contains multiple words, the term will only match if all of the words
270 are found immediately adjacent, and in the given order.
271 The word search is performed on those fields that are indexed as
272 type <literal>w</literal> in the <literal>.abs</literal> file.
276 If the <emphasis>Structure</emphasis> attribute is
277 <emphasis>Word List</emphasis>,
278 <emphasis>Free-form Text</emphasis>, or
279 <emphasis>Document Text</emphasis>, the term is treated as a
280 natural-language, relevance-ranked query.
281 This search type uses the word register, i.e. those fields
282 that are indexed as type <literal>w</literal> in the
283 <literal>.abs</literal> file.
287 If the <emphasis>Structure</emphasis> attribute is
288 <emphasis>Numeric String</emphasis> the term is treated as an integer.
289 The search is performed on those fields that are indexed
290 as type <literal>n</literal> in the <literal>.abs</literal> file.
294 If the <emphasis>Structure</emphasis> attribute is
295 <emphasis>URx</emphasis> the term is treated as a URX (URL) entity.
296 The search is performed on those fields that are indexed as type
297 <literal>u</literal> in the <literal>.abs</literal> file.
301 If the <emphasis>Structure</emphasis> attribute is
302 <emphasis>Local Number</emphasis> the term is treated as
303 native Zebra Record Identifier.
307 If the <emphasis>Relation</emphasis> attribute is
308 <emphasis>Equals</emphasis> (default), the term is matched
309 in a normal fashion (modulo truncation and processing of
310 individual words, if required).
311 If <emphasis>Relation</emphasis> is <emphasis>Less Than</emphasis>,
312 <emphasis>Less Than or Equal</emphasis>,
313 <emphasis>Greater than</emphasis>, or <emphasis>Greater than or
314 Equal</emphasis>, the term is assumed to be numerical, and a
315 standard regular expression is constructed to match the given
317 If <emphasis>Relation</emphasis> is <emphasis>Relevance</emphasis>,
318 the standard natural-language query processor is invoked.
322 For the <emphasis>Truncation</emphasis> attribute,
323 <emphasis>No Truncation</emphasis> is the default.
324 <emphasis>Left Truncation</emphasis> is not supported.
325 <emphasis>Process # in search term</emphasis> is supported, as is
326 <emphasis>Regxp-1</emphasis>.
327 <emphasis>Regxp-2</emphasis> enables the fault-tolerant (fuzzy)
328 search. As a default, a single error (deletion, insertion,
329 replacement) is accepted when terms are matched against the register
334 <title>Regular expressions</title>
337 Each term in a query is interpreted as a regular expression if
338 the truncation value is either <emphasis>Regxp-1</emphasis> (102)
339 or <emphasis>Regxp-2</emphasis> (103).
340 Both query types follow the same syntax with the operands:
347 Matches the character <emphasis>x</emphasis>.
355 Matches any character.
360 <term><literal>[</literal>..<literal>]</literal></term>
363 Matches the set of characters specified;
364 such as <literal>[abc]</literal> or <literal>[a-c]</literal>.
376 Matches <emphasis>x</emphasis> zero or more times. Priority: high.
384 Matches <emphasis>x</emphasis> one or more times. Priority: high.
392 Matches <emphasis>x</emphasis> zero or once. Priority: high.
400 Matches <emphasis>x</emphasis>, then <emphasis>y</emphasis>.
409 Matches either <emphasis>x</emphasis> or <emphasis>y</emphasis>.
415 The order of evaluation may be changed by using parentheses.
419 If the first character of the <emphasis>Regxp-2</emphasis> query
420 is a plus character (<literal>+</literal>) it marks the
421 beginning of a section with non-standard specifiers.
422 The next plus character marks the end of the section.
423 Currently Zebra only supports one specifier, the error tolerance,
424 which consists one digit.
428 Since the plus operator is normally a suffix operator the addition to
429 the query syntax doesn't violate the syntax for standard regular
436 <title>Query examples</title>
439 Phrase search for <emphasis>information retrieval</emphasis> in
442 @attr 1=4 "information retrieval"
447 Ranked search for the same thing:
449 @attr 1=4 @attr 2=102 "Information retrieval"
454 Phrase search with a regular expression:
456 @attr 1=4 @attr 5=102 "informat.* retrieval"
461 Ranked search with a regular expression:
463 @attr 1=4 @attr 5=102 @attr 2=102 "informat.* retrieval"
468 In the GILS schema (<literal>gils.abs</literal>), the
469 west-bounding-coordinate is indexed as type <literal>n</literal>,
470 and is therefore searched by specifying
471 <emphasis>structure</emphasis>=<emphasis>Numeric String</emphasis>.
472 To match all those records with west-bounding-coordinate greater
473 than -114 we use the following query:
475 @attr 4=109 @attr 2=5 @attr gils 1=2038 -114
482 <title>Present</title>
484 The present facility is supported in a standard fashion. The requested
485 record syntax is matched against the ones supported by the profile of
486 each record retrieved. If no record syntax is given, SUTRS is the
487 default. The requested element set name, again, is matched against any
488 provided by the relevant record profiles.
494 The attribute combinations provided with the termListAndStartPoint are
495 processed in the same way as operands in a query (see above).
496 Currently, only the term and the globalOccurrences are returned with
497 the termInfo structure.
504 Z39.50 specifies three different types of sort criteria.
505 Of these Zebra supports the attribute specification type in which
506 case the use attribute specifies the "Sort register".
507 Sort registers are created for those fields that are of type "sort" in
508 the default.idx file.
509 The corresponding character mapping file in default.idx specifies the
510 ordinal of each character used in the actual sort.
514 Z39.50 allows the client to specify sorting on one or more input
515 result sets and one output result set.
516 Zebra supports sorting on one result set only which may or may not
517 be the same as the output result set.
523 If a Close PDU is received, the server will respond with a Close PDU
524 with reason=FINISHED, no matter which protocol version was negotiated
525 during initialization. If the protocol version is 3 or more, the
526 server will generate a Close PDU under certain circumstances,
527 including a session timeout (60 minutes by default), and certain kinds of
528 protocol errors. Once a Close PDU has been sent, the protocol
529 association is considered broken, and the transport connection will be
530 closed immediately upon receipt of further data, or following a short
536 <!-- Keep this comment at the end of the file
541 sgml-minimize-attributes:nil
542 sgml-always-quote-attributes:t
545 sgml-parent-document: "zebra.xml"
546 sgml-local-catalogs: nil
547 sgml-namecase-general:t