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 <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 server. The data
63 elements are described below. From Pazpar2 version 1.2 this is
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>relevance</term>
109 Specifies ICU tokenization and transformation rules
110 for tokens that are used in Pazpar2's relevance ranking. 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 transformation 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>transform</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.
164 Specifies ICU tokenization and transformation rules
165 for tokens that are used in Pazpar2's sorting. The contents
166 is similar to that of <literal>relevance</literal>.
172 <term>mergekey</term>
175 Specifies ICU tokenization and transformation rules
176 for tokens that are used in Pazpar2's mergekey. The contents
177 is similar to that of <literal>relevance</literal>.
186 This nested element controls the behavior of Pazpar2 with
187 respect to your data model. In Pazpar2, incoming records are
188 normalized, using XSLT, into an internal representation.
189 The 'service' section controls the further processing and
190 extraction of data from the internal representation, primarily
191 through the 'metadata' sub-element.
194 Pazpar2 version 1.2 and later allows multiple service elements.
195 Multiple services must be given a unique ID by specifying
196 attribute <literal>id</literal>.
197 A single service may be unnamed (service ID omitted). The
198 service ID is referred to in the <literal>init</literal> webservice
199 command's <literal>service</literal> parameter.
202 <variablelist> <!-- Level 2 -->
203 <varlistentry><term>metadata</term>
206 One of these elements is required for every data element in
207 the internal representation of the record (see
208 <xref linkend="data_model"/>. It governs
209 subsequent processing as pertains to sorting, relevance
210 ranking, merging, and display of data elements. It supports
211 the following attributes:
214 <variablelist> <!-- level 3 -->
215 <varlistentry><term>name</term>
218 This is the name of the data element. It is matched
219 against the 'type' attribute of the
221 in the normalized record. A warning is produced if
222 metadata elements with an unknown name are
224 normalized record. This name is also used to
226 data elements in the records returned by the
227 webservice API, and to name sort lists and browse
233 <varlistentry><term>type</term>
236 The type of data element. This value governs any
237 normalization or special processing that might take
238 place on an element. Possible values are 'generic'
239 (basic string), 'year' (a range is computed if
240 multiple years are found in the record). Note: This
241 list is likely to increase in the future.
246 <varlistentry><term>brief</term>
249 If this is set to 'yes', then the data element is
250 includes in brief records in the webservice API. Note
251 that this only makes sense for metadata elements that
252 are merged (see below). The default value is 'no'.
257 <varlistentry><term>sortkey</term>
260 Specifies that this data element is to be used for
261 sorting. The possible values are 'numeric' (numeric
262 value), 'skiparticle' (string; skip common, leading
263 articles), and 'no' (no sorting). The default value is
269 <varlistentry><term>rank</term>
272 Specifies that this element is to be used to
274 records against the user's query (when ranking is
275 requested). The value is an integer, used as a
276 multiplier against the basic TF*IDF score. A value of
277 1 is the base, higher values give additional
279 elements of this type. The default is '0', which
280 excludes this element from the rank calculation.
285 <varlistentry><term>termlist</term>
288 Specifies that this element is to be used as a
289 termlist, or browse facet. Values are tabulated from
290 incoming records, and a highscore of values (with
291 their associated frequency) is made available to the
292 client through the webservice API.
294 are 'yes' and 'no' (default).
299 <varlistentry><term>merge</term>
302 This governs whether, and how elements are extracted
303 from individual records and merged into cluster
304 records. The possible values are: 'unique' (include
305 all unique elements), 'longest' (include only the
306 longest element (strlen), 'range' (calculate a range
307 of values across all matching records), 'all' (include
308 all elements), or 'no' (don't merge; this is the
314 <varlistentry><term>mergekey</term>
317 If set to <literal>yes</literal>, the value of this
318 metadata element is appended to the resulting mergekey.
319 By default metadata is not part of a mergekey.
325 <varlistentry><term>setting</term>
328 This attribute allows you to make use of static database
329 settings in the processing of records. Three possible values
330 are allowed. 'no' is the default and doesn't do anything.
331 'postproc' copies the value of a setting with the same name
332 into the output of the normalization stylesheet(s). 'parameter'
333 makes the value of a setting with the same name available
334 as a parameter to the normalization stylesheet, so you
335 can further process the value inside of the stylesheet, or use
336 the value to decide how to deal with other data values.
340 The purpose of using settings in this way can either be to
341 control the behavior of normalization stylesheet in a database-
342 dependent way, or to easily make database-dependent values
343 available to display-logic in your user interface, without having
344 to implement complicated interactions between the user interface
345 and your configuration system.
348 </variablelist> <!-- attributes to metadata -->
352 </variablelist> <!-- Data elements in service directive -->
355 </variablelist> <!-- Data elements in server directive -->
360 <refsect1><title>EXAMPLE</title>
361 <para>Below is a working example configuration:
363 <?xml version="1.0" encoding="UTF-8"?>
364 <pazpar2 xmlns="http://www.indexdata.com/pazpar2/1.0">
367 <listen port="9004"/>
368 <proxy host="us1.indexdata.com" myurl="us1.indexdata.com"/>
370 <!-- optional ICU ranking configuration example -->
372 <icu_chain id="el:word" locale="el">
373 <normalize rule="[:Control:] Any-Remove"/>
375 <normalize rule="[[:WhiteSpace:][:Punctuation:]] Remove"/>
382 <metadata name="title" brief="yes" sortkey="skiparticle" merge="longest" rank="6"/>
383 <metadata name="isbn" merge="unique"/>
384 <metadata name="date" brief="yes" sortkey="numeric" type="year" merge="range"
386 <metadata name="author" brief="yes" termlist="yes" merge="longest" rank="2"/>
387 <metadata name="subject" merge="unique" termlist="yes" rank="3"/>
388 <metadata name="url" merge="unique"/>
397 <refsect1 id="target_settings"><title>TARGET SETTINGS</title>
399 Pazpar2 features a cunning scheme by which you can associate various
400 kinds of attributes, or settings with search targets. This can be done
401 through XML files which are read at startup; each file can associate
402 one or more settings with one or more targets. The file format is generic
403 in nature, designed to support a wide range of application requirements. The
404 settings can be purely technical things, like, how to perform a title
405 search against a given target, or it can associate arbitrary name=value
406 pairs with groups of targets -- for instance, if you would like to
407 place all commercial full-text bases in one group for selection
408 purposes, or you would like to control what targets are accessible
409 to users by default. Per-database settings values can even be used
410 to drive sorting, facet/termlist generation, or end-user interface display
415 During startup, Pazpar2 will recursively read a specified directory
416 (can be identified in the pazpar2.cfg file or on the command line), and
417 process any settings files found therein.
421 Clients of the Pazpar2 webservice interface can selectively override
422 settings for individual targets within the scope of one session. This
423 can be used in conjunction with an external authentication system to
424 determine which resources are to be accessible to which users. Pazpar2
425 itself has no notion of end-users, and so can be used in conjunction
426 with any type of authentication system. Similarly, the authentication
427 tokens submitted to access-controlled search targets can similarly be
428 overridden, to allow use of Pazpar2 in a consortial or multi-library
429 environment, where different end-users may need to be represented to
430 some search targets in different ways. This, again, can be managed
431 using an external database or other lookup mechanism. Setting overrides
432 can be performed either using the 'init' or the 'settings' webservice
437 In fact, every setting that applies to a database (except pz:id, which
438 can only be used for filtering targets to use for a search) can be overridden
439 on a per-session basis. This allows the client to override specific CCL fields
440 for searching, etc., to meet the needs of a session or user.
444 Finally, as an extreme case of this, the webservice client can
445 introduce entirely new targets, on the fly, as part of the init or
446 settings command. This is useful if you desire to manage information
447 about your search targets in a separate application such as a database.
448 You do not need any static settings file whatsoever to run Pazpar2 -- as
449 long as the webservice client is prepared to supply the necessary
450 information at the beginning of every session.
455 The following discussion of practical issues related to session and settings
456 management are cast in terms of a user interface based on Ajax/Javascript
457 technology. It would apply equally well to many other kinds of browser-based logic.
462 Typically, a Javascript client is not allowed to directly alter the parameters
463 of a session. There are two reasons for this. One has to do with access
464 to information; typically, information about a user will be stored in a
465 system on the server side, or it will be accessible in some way from the server.
466 However, since the Javascript client cannot be entirely trusted (some hostile
467 agent might in fact 'pretend' to be a regular ws client), it is more robust
468 to control session settings from scripting that you run as part of your
469 webserver. Typically, this can be handled during the session initialization,
474 Step 1: The Javascript client loads, and asks the webserver for a new Pazpar2
475 session ID. This can be done using a Javascript call, for instance. Note that
476 it is possible to submit Ajax HTTPXmlRequest calls either to Pazpar2 or to the
477 webserver that Pazpar2 is proxying for. See (XXX Insert link to Pazpar2 protocol).
481 Step 2: Code on the webserver authenticates the user, by database lookup,
482 LDAP access, NCIP, etc. Determines which resources the user has access to,
483 and any user-specific parameters that are to be applied during this session.
487 Step 3: The webserver initializes a new Pazpar2 settings, and sets user-specific
488 parameters as necessary, using the init webservice command. A new session ID is
493 Step 4: The webserver returns this session ID to the Javascript client, which then
494 uses the session ID to submit searches, show results, etc.
498 Step 5: When the Javascript client ceases to use the session, Pazpar2 destroys
499 any session-specific information.
502 <refsect2><title>SETTINGS FILE FORMAT</title>
504 Each file contains a root element named <settings>. It may
505 contain one or more <set> elements. The settings and set
506 elements may contain the following attributes. Attributes in the set node
507 overrides those in the setting root element. Each set node must
508 specify (directly, or inherited from the parent node) at least a
509 target, name, and value.
517 This specifies the search target to which this setting should be
518 applied. Targets are identified by their Z39.50 URL, generally
519 including the host, port, and database name, (e.g.
520 <literal>bagel.indexdata.com:210/marc</literal>).
521 Two wildcard forms are accepted:
522 * (asterisk) matches all known targets;
523 <literal>bagel.indexdata.com:210/*</literal> matches all
524 known databases on the given host.
527 A precedence system determines what happens if there are
528 overlapping values for the same setting name for the same
529 target. A setting for a specific target name overrides a
530 setting which specifies target using a wildcard. This makes it
531 easy to set defaults for all targets, and then override them
532 for specific targets or hosts. If there are
533 multiple overlapping settings with the same name and target
534 value, the 'precedence' attribute determines what happens.
542 The name of the setting. This can be anything you like.
543 However, Pazpar2 reserves a number of setting names for
544 specific purposes, all starting with 'pz:', and it is a good
545 idea to avoid that prefix if you make up your own setting
546 names. See below for a list of reserved variables.
554 The value of the setting. Generally, this can be anything you
555 want -- however, some of the reserved settings may expect
556 specific kinds of values.
561 <term>precedence</term>
564 This should be an integer. If not provided, the default value
565 is 0. If two (or more) settings have the same content for
566 target and name, the precedence value determines the outcome.
567 If both settings have the same precedence value, they are both
568 applied to the target(s). If one has a higher value, then the
569 value of that setting is applied, and the other one is ignored.
576 By setting defaults for target, name, or value in the root
577 settings node, you can use the settings files in many different
578 ways. For instance, you can use a single file to set defaults for
579 many different settings, like search fields, retrieval syntaxes,
580 etc. You can have one file per server, which groups settings for
581 that server or target. You could also have one file which associates
582 a number of targets with a given setting, for instance, to associate
583 many databases with a given category or class that makes sense
584 within your application.
588 The following examples illustrate uses of the settings system to
589 associate settings with targets to meet different requirements.
593 The example below associates a set of default values that can be
594 used across many targets. Note the wildcard for targets.
595 This associates the given settings with all targets for which no
596 other information is provided.
598 <settings target="*">
600 <!-- This file introduces default settings for pazpar2 -->
602 <!-- mapping for unqualified search -->
603 <set name="pz:cclmap:term" value="u=1016 t=l,r s=al"/>
605 <!-- field-specific mappings -->
606 <set name="pz:cclmap:ti" value="u=4 s=al"/>
607 <set name="pz:cclmap:su" value="u=21 s=al"/>
608 <set name="pz:cclmap:isbn" value="u=7"/>
609 <set name="pz:cclmap:issn" value="u=8"/>
610 <set name="pz:cclmap:date" value="u=30 r=r"/>
612 <!-- Retrieval settings -->
614 <set name="pz:requestsyntax" value="marc21"/>
615 <set name="pz:elements" value="F"/>
617 <!-- Query encoding -->
618 <set name="pz:queryencoding" value="iso-8859-1"/>
620 <!-- Result normalization settings -->
622 <set name="pz:nativesyntax" value="iso2709"/>
623 <set name="pz:xslt" value="../etc/marc21.xsl"/>
631 The next example shows certain settings overridden for one target,
632 one which returns XML records containing DublinCore elements, and
633 which furthermore requires a username/password.
635 <settings target="funkytarget.com:210/db1">
636 <set name="pz:requestsyntax" value="xml"/>
637 <set name="pz:nativesyntax" value="xml"/>
638 <set name="pz:xslt" value="../etc/dublincore.xsl"/>
640 <set name="pz:authentication" value="myuser/password"/>
646 The following example associates a specific name/value combination
647 with a number of targets. The targets below are access-restricted,
648 and can only be used by users with special credentials.
650 <settings name="pz:allow" value="0">
651 <set target="funkytarget.com:210/*"/>
652 <set target="commercial.com:2100/expensiveDb"/>
659 <refsect2><title>RESERVED SETTING NAMES</title>
661 The following setting names are reserved by Pazpar2 to control the
662 behavior of the client function.
667 <term>pz:cclmap:xxx</term>
670 This establishes a CCL field definition or other setting, for
671 the purpose of mapping end-user queries. XXX is the field or
672 setting name, and the value of the setting provides parameters
673 (e.g. parameters to send to the server, etc.). Please consult
674 the YAZ manual for a full overview of the many capabilities of
675 the powerful and flexible CCL parser.
678 Note that it is easy to establish a set of default parameters,
679 and then override them individually for a given target.
684 <term>pz:requestsyntax</term>
687 This specifies the record syntax to use when requesting
688 records from a given server. The value can be a symbolic name like
689 marc21 or xml, or it can be a Z39.50-style dot-separated OID.
694 <term>pz:elements</term>
697 The element set name to be used when retrieving records from a
703 <term>pz:piggyback</term>
706 Piggybacking enables the server to retrieve records from the
707 server as part of the search response in Z39.50. Almost all
708 servers support this (or fail it gracefully), but a few
709 servers will produce undesirable results.
710 Set to '1' to enable piggybacking, '0' to disable it. Default
711 is 1 (piggybacking enabled).
716 <term>pz:nativesyntax</term>
719 The representation (syntax) of the retrieval records. Currently
720 recognized values are iso2709 and xml.
723 For iso2709, can also specify a native character set, e.g. "iso2709;latin-1".
724 If no character set is provided, MARC-8 is assumed.
727 If pz:nativesyntax is not specified, pazpar2 will attempt to determine
728 the value based on the response from the server.
734 <term>pz:queryencoding</term>
737 The encoding of the search terms that a target accepts. Most
738 targets do not honor UTF-8 in which case this needs to be specified.
739 Each term in a query will be converted if this setting is given.
748 Provides the path of an XSLT stylesheet which will be used to
749 map incoming records to the internal representation.
754 <term>pz:authentication</term>
757 Sets an authentication string for a given server. See the section on
758 authorization and authentication for discussion.
763 <term>pz:allow</term>
766 Allows or denies access to the resources it is applied to. Possible
767 values are '0' and '1'. The default is '1' (allow access to this resource).
768 See the manual section on authorization and authentication for discussion
769 about how to use this setting.
774 <term>pz:maxrecs</term>
777 Controls the maximum number of records to be retrieved from a
778 server. The default is 100.
786 This setting can't be 'set' -- it contains the ID (normally
787 ZURL) for a given target, and is useful for filtering --
788 specifically when you want to select one or more specific
789 targets in the search command.
794 <term>pz:zproxy</term>
797 The 'pz:zproxy' setting has the value syntax
798 'host.internet.adress:port', it is used to tunnel Z39.50
799 requests through the named Z39.50 proxy.
805 <term>pz:apdulog</term>
808 If the 'pz:apdulog' setting is defined and has other value than 0,
809 then Z39.50 APDUs are written to the log.
818 This setting enables SRU/SRW support. It has three possible settings.
819 'get', enables SRU access through GET requests. 'post' enables SRU/POST
820 support, less commonly supported, but useful if very large requests are
821 to be submitted. 'srw' enables the SRW variation of the protocol.
827 <term>pz:sru_version</term>
830 This allows SRU version to be specified. If unset Pazpar2
831 will the default of YAZ (currently 1.2). Should be set
838 <term>pz:pqf_prefix</term>
841 Allows you to specify an arbitrary PQF query language substring. The provided
842 string is prefixed the user's query after it has been normalized to PQF
843 internally in pazpar2. This allows you to attach complex 'filters' to
844 queries for a gien target, sometimes necessary to select sub-catalogs
845 in union catalog systems, etc.
853 <refsect1><title>SEE ALSO</title>
856 <refentrytitle>pazpar2</refentrytitle>
857 <manvolnum>8</manvolnum>
860 <refentrytitle>yaz-icu</refentrytitle>
861 <manvolnum>1</manvolnum>
864 <refentrytitle>pazpar2_protocol</refentrytitle>
865 <manvolnum>7</manvolnum>
870 <!-- Keep this comment at the end of the file
875 sgml-minimize-attributes:nil
876 sgml-always-quote-attributes:t
879 sgml-parent-document:nil
880 sgml-local-catalogs: nil
881 sgml-namecase-general:t