1 <?xml version="1.0" standalone="no"?>
2 <!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook V4.1//EN"
3 "http://www.oasis-open.org/docbook/xml/4.1/docbookx.dtd"
5 <!ENTITY % local SYSTEM "local.ent">
7 <!ENTITY % entities SYSTEM "entities.ent">
9 <!ENTITY % idcommon SYSTEM "common/common.ent">
12 <!-- $Id: pazpar2_conf.xml,v 1.29 2007-07-06 20:12:40 adam Exp $ -->
13 <refentry id="pazpar2_conf">
15 <productname>Pazpar2</productname>
16 <productnumber>&version;</productnumber>
19 <refentrytitle>Pazpar2 conf</refentrytitle>
20 <manvolnum>5</manvolnum>
24 <refname>pazpar2_conf</refname>
25 <refpurpose>Pazpar2 Configuration</refpurpose>
30 <command>pazpar2.conf</command>
34 <refsect1><title>DESCRIPTION</title>
36 The Pazpar2 configuration file, together with any referenced XSLT files,
37 govern Pazpar2's behavior as a client, and control the normalization and
38 extraction of data elements from incoming result records, for the
39 purposes of merging, sorting, facet analysis, and display.
43 The file is specified using the option -f on the Pazpar2 command line.
44 There is not presently a way to reload the configuration file without
45 restarting Pazpar2, although this will most likely be added some time
50 <refsect1><title>FORMAT</title>
52 The configuration file is XML-structured. It must be valid XML. All
53 elements specific to Pazpar2 should belong to the namespace
54 <literal>http://www.indexdata.com/pazpar2/1.0</literal>
55 (this is assumed in the
56 following examples). The root element is named <literal>pazpar2</literal>.
57 Under the root element are a number of elements which group categories of
58 information. The categories are described below.
61 <refsect2 id="config-server"><title>server</title>
63 This section governs overall behavior of the client. The data
64 elements are described below.
66 <variablelist> <!-- level 1 -->
71 Configures the webservice -- this controls how you can connect
72 to Pazpar2 from your browser or server-side code. The
73 attributes 'host' and 'port' control the binding of the
74 server. The 'host' attribute can be used to bind the server to
75 a secondary IP address of your system, enabling you to run
76 Pazpar2 on port 80 alongside a conventional web server. You
77 can override this setting on the command line using the option -h.
86 If this item is given, Pazpar2 will forward all incoming HTTP
87 requests that do not contain the filename 'search.pz2' to the
88 host and port specified using the 'host' and 'port'
89 attributes. The 'myurl' attribute is required, and should provide
90 the base URL of the server. Generally, the HTTP URL for the host
91 specified in the 'listen' parameter. This functionality is
92 crucial if you wish to use
93 Pazpar2 in conjunction with browser-based code (JS, Flash,
94 applets, etc.) which operates in a security sandbox. Such code
95 can only connect to the same server from which the enclosing
96 HTML page originated. Pazpar2s proxy functionality enables you
97 to host all of the main pages (plus images, CSS, etc) of your
98 application on a conventional webserver, while efficiently
99 processing webservice requests for metasearch status, results,
106 <term>icu_chain</term>
109 Definition of ICU tokenization and normalization rules
110 are used if ICU support is compiled in. The 'id'
111 attribute is currently not used, and the 'locale'
112 attribute must be set to one of the locale strings
113 defined in ICU. The child elements listed below can be
114 in any order, except the 'index' element which logically
115 belongs to the end of the list. The stated tokenization,
116 normalization and charmapping instructions are performed
117 in order from top to bottom.
119 <variablelist> <!-- Level 2 -->
120 <varlistentry><term>casemap</term>
123 The attribute 'rule' defines the direction of the
124 per-character casemapping, allowed values are "l"
125 (lower), "u" (upper), "t" (title).
129 <varlistentry><term>normalize</term>
132 Normalization and transformation of tokens follows
133 the rules defined in the 'rule' attribute. For
134 possible values we refer to the extensive ICU
135 documentation found at the
136 <ulink url="&url.icu.transform;">ICU
137 transformation</ulink> home page. Set filtering
138 principles are explained at the
139 <ulink url="&url.icu.unicode.set;">ICU set and
140 filtering</ulink> page.
144 <varlistentry><term>tokenize</term>
147 Tokenization is the only rule in the ICU chain
148 which splits one token into multiple tokens. The
149 'rule' attribute may have the following values:
150 "s" (sentence), "l" (line-break), "w" (word), and
151 "c" (character), the later probably not being
152 very useful in a pruning Pazpar2 installation.
156 <varlistentry><term>index</term>
159 Finally the 'index' element instruction - without
160 any 'rule' attribute - is used to store the tokens
161 after chain processing in the relevance ranking
162 unit of Pazpar2. It will always be the last
163 instruction in the chain.
175 This nested element controls the behavior of Pazpar2 with
176 respect to your data model. In Pazpar2, incoming records are
177 normalized, using XSLT, into an internal representation.
178 The 'service' section controls the further processing and
179 extraction of data from the internal representation, primarily
180 through the 'metadata' sub-element.
183 <variablelist> <!-- Level 2 -->
184 <varlistentry><term>metadata</term>
187 One of these elements is required for every data element in
188 the internal representation of the record (see
189 <xref linkend="data_model"/>. It governs
190 subsequent processing as pertains to sorting, relevance
191 ranking, merging, and display of data elements. It supports
192 the following attributes:
195 <variablelist> <!-- level 3 -->
196 <varlistentry><term>name</term>
199 This is the name of the data element. It is matched
200 against the 'type' attribute of the
202 in the normalized record. A warning is produced if
203 metadata elements with an unknown name are
205 normalized record. This name is also used to
207 data elements in the records returned by the
208 webservice API, and to name sort lists and browse
214 <varlistentry><term>type</term>
217 The type of data element. This value governs any
218 normalization or special processing that might take
219 place on an element. Possible values are 'generic'
220 (basic string), 'year' (a range is computed if
221 multiple years are found in the record). Note: This
222 list is likely to increase in the future.
227 <varlistentry><term>brief</term>
230 If this is set to 'yes', then the data element is
231 includes in brief records in the webservice API. Note
232 that this only makes sense for metadata elements that
233 are merged (see below). The default value is 'no'.
238 <varlistentry><term>sortkey</term>
241 Specifies that this data element is to be used for
242 sorting. The possible values are 'numeric' (numeric
243 value), 'skiparticle' (string; skip common, leading
244 articles), and 'no' (no sorting). The default value is
250 <varlistentry><term>rank</term>
253 Specifies that this element is to be used to
255 records against the user's query (when ranking is
256 requested). The value is an integer, used as a
257 multiplier against the basic TF*IDF score. A value of
258 1 is the base, higher values give additional
260 elements of this type. The default is '0', which
261 excludes this element from the rank calculation.
266 <varlistentry><term>termlist</term>
269 Specifies that this element is to be used as a
270 termlist, or browse facet. Values are tabulated from
271 incoming records, and a highscore of values (with
272 their associated frequency) is made available to the
273 client through the webservice API.
275 are 'yes' and 'no' (default).
280 <varlistentry><term>merge</term>
283 This governs whether, and how elements are extracted
284 from individual records and merged into cluster
285 records. The possible values are: 'unique' (include
286 all unique elements), 'longest' (include only the
287 longest element (strlen), 'range' (calculate a range
288 of values across all matching records), 'all' (include
289 all elements), or 'no' (don't merge; this is the
294 </variablelist> <!-- attributes to metadata -->
298 </variablelist> <!-- Data elements in service directive -->
301 </variablelist> <!-- Data elements in server directive -->
306 <refsect1><title>EXAMPLE</title>
307 <para>Below is a working example configuration:
309 <?xml version="1.0" encoding="UTF-8"?>
310 <pazpar2 xmlns="http://www.indexdata.com/pazpar2/1.0">
313 <listen port="9004"/>
314 <proxy host="us1.indexdata.com" myurl="us1.indexdata.com"/>
316 <!-- optional ICU ranking configuration example -->
318 <icu_chain id="el:word" locale="el">
319 <normalize rule="[:Control:] Any-Remove"/>
321 <normalize rule="[[:WhiteSpace:][:Punctuation:]] Remove"/>
328 <metadata name="title" brief="yes" sortkey="skiparticle" merge="longest" rank="6"/>
329 <metadata name="isbn" merge="unique"/>
330 <metadata name="date" brief="yes" sortkey="numeric" type="year" merge="range"
332 <metadata name="author" brief="yes" termlist="yes" merge="longest" rank="2"/>
333 <metadata name="subject" merge="unique" termlist="yes" rank="3"/>
334 <metadata name="url" merge="unique"/>
343 <refsect1 id="target_settings"><title>TARGET SETTINGS</title>
345 Pazpar2 features a cunning scheme by which you can associate various
346 kinds of attributes, or settings with search targets. This can be done
347 through XML files which are read at startup; each file can associate
348 one or more settings with one or more targets. The file format is generic
349 in nature, designed to support a wide range of application requirements. The
350 settings can be purely technical things, like, how to perform a title
351 search against a given target, or it can associate arbitrary name=value
352 pairs with groups of targets -- for instance, if you would like to
353 place all commercial full-text bases in one group for selection
354 purposes, or you would like to control what targets are accessible
359 During startup, Pazpar2 will recursively read a specified directory
360 (can be identified in the pazpar2.cfg file or on the command line), and
361 process any settings files found therein.
365 Clients of the Pazpar2 webservice interface can selectively override
366 settings for individual targets within the scope of one session. This
367 can be used in conjunction with an external authentication system to
368 determine which resources are to be accessible to which users. Pazpar2
369 itself has no notion of end-users, and so can be used in conjunction
370 with any type of authentication system. Similarly, the authentication
371 tokens submitted to access-controlled search targets can similarly be
372 overridden, to allow use of Pazpar2 in a consortial or multi-library
373 environment, where different end-users may need to be represented to
374 some search targets in different ways. This, again, can be managed
375 using an external database or other lookup mechanism. Setting overrides
376 can be performed either using the 'init' or the 'settings' webservice
381 In fact, every setting that applies to a database (except pz:id, which
382 can only be used for filtering targets to use for a search) can be overridden
383 on a per-session basis. This allows the client to override specific CCL fields
384 for searching, etc., to meet the needs of a session or user.
388 Finally, as an extreme case of this, the webservice client can
389 introduce entirely new targets, on the fly, as part of the init or
390 settings command. This is useful if you desire to manage information
391 about your search targets in a separate application such as a database.
392 You do not need any static settings file whatsoever to run Pazpar2 -- as
393 long as the webservice client is prepared to supply the necessary
394 information at the beginning of every session.
399 The following discussion of practical issues related to session and settings
400 management are cast in terms of a user interface based on Ajax/Javascript
401 technology. It would apply equally well to many other kinds of browser-based logic.
406 Typically, a Javascript client is not allowed to directly alter the parameters
407 of a session. There are two reasons for this. One has to do with access
408 to information; typically, information about a user will be stored in a
409 system on the server side, or it will be accessible in some way from the server.
410 However, since the Javascript client cannot be entirely trusted (some hostile
411 agent might in fact 'pretend' to be a regular ws client), it is more robust
412 to control session settings from scripting that you run as part of your
413 webserver. Typically, this can be handled during the session initialization,
418 Step 1: The Javascript client loads, and asks the webserver for a new Pazpar2
419 session ID. This can be done using a Javascript call, for instance. Note that
420 it is possible to submit Ajax HTTPXmlRequest calls either to Pazpar2 or to the
421 webserver that Pazpar2 is proxying for. See (XXX Insert link to Pazpar2 protocol).
425 Step 2: Code on the webserver authenticates the user, by database lookup,
426 LDAP access, NCIP, etc. Determines which resources the user has access to,
427 and any user-specific parameters that are to be applied during this session.
431 Step 3: The webserver initializes a new Pazpar2 settings, and sets user-specific
432 parameters as necessary, using the init webservice command. A new session ID is
437 Step 4: The webserver returns this session ID to the Javascript client, which then
438 uses the session ID to submit searches, show results, etc.
442 Step 5: When the Javascript client ceases to use the session, Pazpar2 destroys
443 any session-specific information.
446 <refsect2><title>SETTINGS FILE FORMAT</title>
448 Each file contains a root element named <settings>. It may
449 contain one or more <set> elements. The settings and set
450 elements may contain the following attributes. Attributes in the set node
451 overrides those in the setting root element. Each set node must
452 specify (directly, or inherited from the parent node) at least a
453 target, name, and value.
461 This specifies the search target to which this setting should be
462 applied. Targets are identified by their Z39.50 URL, generally
463 including the host, port, and database name, (e.g.
464 <literal>bagel.indexdata.com:210/marc</literal>).
465 Two wildcard forms are accepted:
466 * (asterisk) matches all known targets;
467 <literal>bagel.indexdata.com:210/*</literal> matches all
468 known databases on the given host.
471 A precedence system determines what happens if there are
472 overlapping values for the same setting name for the same
473 target. A setting for a specific target name overrides a
474 setting which specifies target using a wildcard. This makes it
475 easy to set defaults for all targets, and then override them
476 for specific targets or hosts. If there are
477 multiple overlapping settings with the same name and target
478 value, the 'precedence' attribute determines what happens.
486 The name of the setting. This can be anything you like.
487 However, Pazpar2 reserves a number of setting names for
488 specific purposes, all starting with 'pz:', and it is a good
489 idea to avoid that prefix if you make up your own setting
490 names. See below for a list of reserved variables.
498 The value of the setting. Generally, this can be anything you
499 want -- however, some of the reserved settings may expect
500 specific kinds of values.
505 <term>precedence</term>
508 This should be an integer. If not provided, the default value
509 is 0. If two (or more) settings have the same content for
510 target and name, the precedence value determines the outcome.
511 If both settings have the same precedence value, they are both
512 applied to the target(s). If one has a higher value, then the
513 value of that setting is applied, and the other one is ignored.
520 By setting defaults for target, name, or value in the root
521 settings node, you can use the settings files in many different
522 ways. For instance, you can use a single file to set defaults for
523 many different settings, like search fields, retrieval syntaxes,
524 etc. You can have one file per server, which groups settings for
525 that server or target. You could also have one file which associates
526 a number of targets with a given setting, for instance, to associate
527 many databases with a given category or class that makes sense
528 within your application.
532 The following examples illustrate uses of the settings system to
533 associate settings with targets to meet different requirements.
537 The example below associates a set of default values that can be
538 used across many targets. Note the wildcard for targets.
539 This associates the given settings with all targets for which no
540 other information is provided.
542 <settings target="*">
544 <!-- This file introduces default settings for pazpar2 -->
545 <!-- $Id: pazpar2_conf.xml,v 1.29 2007-07-06 20:12:40 adam Exp $ -->
547 <!-- mapping for unqualified search -->
548 <set name="pz:cclmap:term" value="u=1016 t=l,r s=al"/>
550 <!-- field-specific mappings -->
551 <set name="pz:cclmap:ti" value="u=4 s=al"/>
552 <set name="pz:cclmap:su" value="u=21 s=al"/>
553 <set name="pz:cclmap:isbn" value="u=7"/>
554 <set name="pz:cclmap:issn" value="u=8"/>
555 <set name="pz:cclmap:date" value="u=30 r=r"/>
557 <!-- Retrieval settings -->
559 <set name="pz:requestsyntax" value="marc21"/>
560 <!-- <set name="pz:elements" value="F"/> NOT YET IMPLEMENTED -->
562 <!-- Result normalization settings -->
564 <set name="pz:nativesyntax" value="iso2709"/>
565 <set name="pz:xslt" value="../etc/marc21.xsl"/>
573 The next example shows certain settings overridden for one target,
574 one which returns XML records containing DublinCore elements, and
575 which furthermore requires a username/password.
577 <settings target="funkytarget.com:210/db1">
578 <set name="pz:requestsyntax" value="xml"/>
579 <set name="pz:nativesyntax" value="xml"/>
580 <set name="pz:xslt" value="../etc/dublincore.xsl"/>
582 <set name="pz:authentication" value="myuser/password"/>
588 The following example associates a specific name/value combination
589 with a number of targets. The targets below are access-restricted,
590 and can only be used by users with special credentials.
592 <settings name="pz:allow" value="0">
593 <set target="funkytarget.com:210/*"/>
594 <set target="commercial.com:2100/expensiveDb"/>
601 <refsect2><title>RESERVED SETTING NAMES</title>
603 The following setting names are reserved by Pazpar2 to control the
604 behavior of the client function.
609 <term>pz:cclmap:xxx</term>
612 This establishes a CCL field definition or other setting, for
613 the purpose of mapping end-user queries. XXX is the field or
614 setting name, and the value of the setting provides parameters
615 (e.g. parameters to send to the server, etc.). Please consult
616 the YAZ manual for a full overview of the many capabilities of
617 the powerful and flexible CCL parser.
620 Note that it is easy to establish a set of default parameters,
621 and then override them individually for a given target.
626 <term>pz:requestsyntax</term>
629 This specifies the record syntax to use when requesting
630 records from a given server. The value can be a symbolic name like
631 marc21 or xml, or it can be a Z39.50-style dot-separated OID.
636 <term>pz:elements</term>
639 The element set name to be used when retrieving records from a
640 server (not yet implemented).
645 <term>pz:piggyback</term>
648 Piggybacking enables the server to retrieve records from the
649 server as part of the search response in Z39.50. Almost all
650 servers support this (or fail it gracefully), but a few
651 servers will produce undesirable results.
652 Set to '1' to enable piggybacking, '0' to disable it. Default
653 is 1 (piggybacking enabled).
658 <term>pz:nativesyntax</term>
661 The representation (syntax) of the retrieval records. Currently
662 recognized values are iso2709 and xml.
665 For iso2709, can also specify a native character set, e.g. "iso2709;latin-1".
666 If no character set is provided, MARC-8 is assumed.
674 Provides the path of an XSLT stylesheet which will be used to
675 map incoming records to the internal representation.
680 <term>pz:authentication</term>
683 Sets an authentication string for a given server. See the section on
684 authorization and authentication for discussion.
689 <term>pz:allow</term>
692 Allows or denies access to the resources it is applied to. Possible
693 values are '0' and '1'. The default is '1' (allow access to this resource).
694 See the manual section on authorization and authentication for discussion
695 about how to use this setting.
700 <term>pz:maxrecs</term>
703 Controls the maximum number of records to be retrieved from a
704 server. The default is 100 (not yet implemented).
712 This setting can't be 'set' -- it contains the ID (normally
713 ZURL) for a given target, and is useful for filtering --
714 specifically when you want to select one or more specific
715 targets in the search command.
720 <term>pz:zproxy</term>
723 The 'pz:zproxy' setting has the value syntax
724 'host.internet.adress:port', it is used to tunnel Z39.50
725 requests through the named Z39.50 proxy.
731 <term>pz:apdulog</term>
734 If the 'pz:apdulog' setting is defined and has other value than 0,
735 then Z39.50 APDUs are written to the log.
743 <refsect1><title>SEE ALSO</title>
747 <refentrytitle>pazpar2</refentrytitle>
748 <manvolnum>8</manvolnum>
754 <refentrytitle>pazpar2_protocol</refentrytitle>
755 <manvolnum>7</manvolnum>
760 <!-- Keep this comment at the end of the file
765 sgml-minimize-attributes:nil
766 sgml-always-quote-attributes:t
769 sgml-parent-document:nil
770 sgml-local-catalogs: nil
771 sgml-namecase-general:t