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