Reformat
[pazpar2-moved-to-github.git] / doc / pazpar2_conf.xml
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"
4 [
5      <!ENTITY % local SYSTEM "local.ent">
6      %local;
7      <!ENTITY % entities SYSTEM "entities.ent">
8      %entities;
9      <!ENTITY % idcommon SYSTEM "common/common.ent">
10      %idcommon;
11 ]>
12 <refentry id="pazpar2_conf">
13  <refentryinfo>
14   <productname>Pazpar2</productname>
15   <productnumber>&version;</productnumber>
16  </refentryinfo>
17  <refmeta>
18   <refentrytitle>Pazpar2 conf</refentrytitle>
19   <manvolnum>5</manvolnum>
20  </refmeta>
21  
22  <refnamediv>
23   <refname>pazpar2_conf</refname>
24   <refpurpose>Pazpar2 Configuration</refpurpose>
25  </refnamediv>
26  
27  <refsynopsisdiv>
28   <cmdsynopsis>
29    <command>pazpar2.conf</command>
30   </cmdsynopsis>
31  </refsynopsisdiv>
32  
33  <refsect1><title>DESCRIPTION</title>
34   <para>
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.
39   </para>
40   
41   <para>
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
45    in the future.
46   </para>
47  </refsect1>
48  
49  <refsect1><title>FORMAT</title>
50   <para>
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.
58   </para>
59   
60   <refsect2 id="config-server"><title>server</title>
61    <para>
62     This section governs overall behavior of the server. The data
63     elements are described below. From Pazpar2 version 1.2 this is
64     a repeatable element.
65    </para>
66    <variablelist> <!-- level 1 -->
67     <varlistentry>
68      <term>listen</term>
69      <listitem>
70       <para>
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.
78       </para>
79      </listitem>
80     </varlistentry>
81     
82     <varlistentry>
83      <term>proxy</term>
84      <listitem>
85       <para>
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,
100        etc.
101       </para>
102      </listitem>
103     </varlistentry>
104
105     <varlistentry>
106      <term>relevance / sort / mergekey</term>
107      <listitem>
108       <para>
109        Specifies character set normalization for relevancy / sorting 
110        and the mergekey - for the server. These definitions serves as
111        default for services that don't have these given. For the meaning
112        of these settings refer to the "relevance" element inside service.
113       </para>
114      </listitem>
115     </varlistentry>
116     
117     <varlistentry>
118      <term>settings</term>
119      <listitem>
120       <para>
121        Specifies target settings for the server.. These settings serves
122        as default for all services which don't have these given.
123        The settings element requires one attribute 'src' which specifies
124        a settings file or a directory . If a directory is given all
125        files with suffix <filename>.xml</filename> is read from this
126        directory. Refer to 
127        <xref linkend="target_settings"/> for more information.
128       </para>
129      </listitem>
130     </varlistentry>
131     
132     <varlistentry>
133      <term>service</term>
134      <listitem>
135       <para>
136        This nested element controls the behavior of Pazpar2 with
137        respect to your data model. In Pazpar2, incoming records are
138        normalized, using XSLT, into an internal representation.
139        The 'service' section controls the further processing and
140        extraction of data from the internal representation, primarily
141        through the 'metadata' sub-element.
142       </para>
143       <para>
144        Pazpar2 version 1.2 and later allows multiple service elements.
145        Multiple services must be given a unique ID by specifying
146        attribute <literal>id</literal>.
147        A single service may be unnamed (service ID omitted). The
148        service ID is referred to in the
149        <link linkend="command-init"><literal>init</literal></link> webservice
150        command's <literal>service</literal> parameter.
151       </para>
152
153       <variablelist> <!-- Level 2 -->
154        <varlistentry><term>metadata</term>
155         <listitem>
156          <para>
157           One of these elements is required for every data element in
158           the internal representation of the record (see
159           <xref linkend="data_model"/>. It governs
160            subsequent processing as pertains to sorting, relevance
161            ranking, merging, and display of data elements. It supports
162            the following attributes:
163          </para>
164          
165          <variablelist> <!-- level 3 -->
166           <varlistentry><term>name</term>
167            <listitem>
168             <para>
169              This is the name of the data element. It is matched
170              against the 'type' attribute of the
171              'metadata' element 
172              in the normalized record. A warning is produced if
173              metadata elements with an unknown name are
174              found in the 
175              normalized record. This name is also used to
176              represent 
177              data elements in the records returned by the
178              webservice API, and to name sort lists and browse
179              facets.
180             </para>
181            </listitem>
182           </varlistentry>
183           
184           <varlistentry><term>type</term>
185            <listitem>
186             <para>
187              The type of data element. This value governs any
188              normalization or special processing that might take
189              place on an element. Possible values are 'generic'
190              (basic string), 'year' (a range is computed if
191              multiple years are found in the record). Note: This
192              list is likely to increase in the future.
193             </para>
194            </listitem>
195           </varlistentry>
196           
197           <varlistentry><term>brief</term>
198            <listitem>
199             <para>
200              If this is set to 'yes', then the data element is
201              includes in brief records in the webservice API. Note
202              that this only makes sense for metadata elements that
203              are merged (see below). The default value is 'no'.
204             </para>
205            </listitem>
206           </varlistentry>
207           
208           <varlistentry><term>sortkey</term>
209            <listitem>
210             <para>
211              Specifies that this data element is to be used for
212              sorting. The possible values are 'numeric' (numeric
213              value), 'skiparticle' (string; skip common, leading
214              articles), and 'no' (no sorting). The default value is
215              'no'.
216             </para>
217            </listitem>
218           </varlistentry>
219           
220           <varlistentry><term>rank</term>
221            <listitem>
222             <para>
223              Specifies that this element is to be used to
224              help rank 
225              records against the user's query (when ranking is
226              requested). The value is an integer, used as a
227              multiplier against the basic TF*IDF score. A value of
228              1 is the base, higher values give additional
229              weight to 
230              elements of this type. The default is '0', which
231              excludes this element from the rank calculation.
232             </para>
233            </listitem>
234           </varlistentry>
235           
236           <varlistentry><term>termlist</term>
237            <listitem>
238             <para>
239              Specifies that this element is to be used as a
240              termlist, or browse facet. Values are tabulated from
241              incoming records, and a highscore of values (with
242              their associated frequency) is made available to the
243              client through the webservice API. 
244              The possible values
245              are 'yes' and 'no' (default).
246             </para>
247            </listitem>
248           </varlistentry>
249           
250           <varlistentry><term>merge</term>
251            <listitem>
252             <para>
253              This governs whether, and how elements are extracted
254              from individual records and merged into cluster
255              records. The possible values are: 'unique' (include
256              all unique elements), 'longest' (include only the
257              longest element (strlen), 'range' (calculate a range
258              of values across all matching records), 'all' (include
259              all elements), or 'no' (don't merge; this is the
260              default);
261             </para>
262            </listitem>
263           </varlistentry>
264
265           <varlistentry><term>mergekey</term>
266            <listitem>
267             <para>
268              If set to '<literal>required</literal>', the value of this
269              metadata element is appended to the resulting mergekey if
270              the metadata is present in a record instance.
271              If the metadata element is not present, the a unique mergekey
272              will be generated instead.
273             </para>
274             <para>
275              If set to '<literal>optional</literal>', the value of this
276              metadata element is appended to the resulting mergekey if the
277              the metadata is present in a record instance. If the metadata
278              is not present, it will be empty.
279             </para>
280             <para>
281              If set to '<literal>no</literal>' or the mergekey attribute is
282              omitted, the metadata will not be used in the creation of a
283              mergekey.
284             </para>
285            </listitem>
286           </varlistentry>
287
288           <varlistentry><term>setting</term>
289            <listitem>
290             <para>
291              This attribute allows you to make use of static database
292              settings in the processing of records. Three possible values
293              are allowed. 'no' is the default and doesn't do anything.
294              'postproc' copies the value of a setting with the same name
295              into the output of the normalization stylesheet(s). 'parameter'
296              makes the value of a setting with the same name available 
297              as a parameter to the normalization stylesheet, so you
298              can further process the value inside of the stylesheet, or use
299              the value to decide how to deal with other data values.
300             </para>
301             <para>
302              The purpose of using settings in this way can either be to
303              control the behavior of normalization stylesheet in a database-
304              dependent way, or to easily make database-dependent values
305              available to display-logic in your user interface, without having
306              to implement complicated interactions between the user interface
307              and your configuration system.
308             </para>
309            </listitem>
310           </varlistentry>
311           
312          </variablelist> <!-- attributes to metadata -->
313          
314         </listitem>
315        </varlistentry>
316        
317        <varlistentry>
318         <term>relevance</term>
319         <listitem>
320          <para>
321           Specifies ICU tokenization and transformation rules
322           for tokens that are used in Pazpar2's relevance ranking.
323           The 'id' attribute is currently not used, and the 'locale'
324           attribute must be set to one of the locale strings
325           defined in ICU. The child elements listed below can be
326           in any order, except the 'index' element which logically
327           belongs to the end of the list. The stated tokenization,
328           transformation and charmapping instructions are performed
329           in order from top to bottom. 
330          </para>
331          <variablelist> <!-- Level 2 -->
332           <varlistentry><term>casemap</term>
333            <listitem>
334             <para>
335              The attribute 'rule' defines the direction of the
336              per-character casemapping, allowed values are "l"
337              (lower), "u" (upper), "t" (title).  
338             </para>
339            </listitem>
340           </varlistentry>
341           <varlistentry><term>transform</term>
342            <listitem>
343             <para>
344              Normalization and transformation of tokens follows
345              the rules defined in the 'rule' attribute. For
346              possible values we refer to the extensive ICU
347              documentation found at the 
348              <ulink url="&url.icu.transform;">ICU
349               transformation</ulink> home page. Set filtering
350              principles are explained at the 
351              <ulink url="&url.icu.unicode.set;">ICU set and
352               filtering</ulink> page.
353             </para>
354            </listitem>
355           </varlistentry>
356           <varlistentry><term>tokenize</term>
357            <listitem>
358             <para>
359              Tokenization is the only rule in the ICU chain
360              which splits one token into multiple tokens. The
361              'rule' attribute may have the following values:
362              "s" (sentence), "l" (line-break), "w" (word), and
363              "c" (character), the later probably not being
364              very useful in a pruning Pazpar2 installation. 
365             </para>
366            </listitem>
367           </varlistentry>
368          </variablelist>
369          <para>
370           From Pazpar2 version 1.1 the ICU wrapper from YAZ is used.
371           Refer to the <ulink url="&url.yaz.yaz-icu;">yaz-icu</ulink>
372           utility for more information.
373          </para>
374         </listitem>
375        </varlistentry>
376        
377        <varlistentry>
378         <term>sort</term>
379         <listitem>
380          <para>
381           Specifies ICU tokenization and transformation rules
382           for tokens that are used in Pazpar2's sorting. The contents
383           is similar to that of <literal>relevance</literal>.
384          </para>
385         </listitem>
386        </varlistentry>
387        
388        <varlistentry>
389         <term>mergekey</term>
390         <listitem>
391          <para>
392           Specifies ICU tokenization and transformation rules
393           for tokens that are used in Pazpar2's mergekey. The contents
394           is similar to that of <literal>relevance</literal>.
395          </para>
396         </listitem>
397        </varlistentry>
398
399        <varlistentry>
400         <term>settings</term>
401         <listitem>
402          <para>
403           Specifies target settings for this service. Refer to
404           <xref linkend="target_settings"/>.
405          </para>
406         </listitem>
407        </varlistentry>
408
409        <varlistentry>
410         <term>timeout</term>
411         <listitem>
412          <para>
413           Specifies timeout parameters for this service.
414           The <literal>timeout</literal>
415           element supports the following attributes: 
416           <literal>session</literal>, <literal>z3950_operation</literal>,
417           <literal>z3950_session</literal> which specifies
418           'session timeout', 'Z39.50 operation timeout',
419           'Z39.50 session timeout' respectively. The Z39.50 operation
420           timeout is the time Pazpar2 will wait for an active Z39.50/SRU
421           operation before it gives up (times out). The Z39.50 session
422           time out is the time Pazpar2 will keep the session alive for
423           an idle session (no operation).
424          </para>
425          <para>
426           The following is recommended but not required:
427           z3950_operation (30) &lt; session (60) &lt; z3950_session (180) .
428           The default values are given in parantheses.
429          </para>
430         </listitem>
431        </varlistentry>
432
433       </variablelist>     <!-- Data elements in service directive -->
434      </listitem>
435     </varlistentry>
436     
437    </variablelist>           <!-- Data elements in server directive -->
438   </refsect2>
439
440  </refsect1>
441  
442  <refsect1><title>EXAMPLE</title>
443   <para>Below is a working example configuration:
444    <screen><![CDATA[
445     <?xml version="1.0" encoding="UTF-8"?>
446     <pazpar2 xmlns="http://www.indexdata.com/pazpar2/1.0">
447     
448       <server>
449         <listen port="9004"/>
450         <service>
451           <metadata name="title" brief="yes" sortkey="skiparticle"
452              merge="longest" rank="6"/>
453           <metadata name="isbn" merge="unique"/>
454           <metadata name="date" brief="yes" sortkey="numeric"
455              type="year" merge="range" termlist="yes"/>
456           <metadata name="author" brief="yes" termlist="yes"
457              merge="longest" rank="2"/>
458           <metadata name="subject" merge="unique" termlist="yes" rank="3"/>
459           <metadata name="url" merge="unique"/>
460           <relevance>
461             <icu_chain id="relevance" locale="el">
462               <transform rule="[:Control:] Any-Remove"/>
463               <tokenize rule="l"/>
464               <transform rule="[[:WhiteSpace:][:Punctuation:]] Remove"/>
465               <casemap rule="l"/>
466              </icu_chain>
467            </relevance>
468            <settings src="mysettings"/>
469            <timeout session="60"/>
470         <service>
471      </server>
472    </pazpar2>
473     ]]></screen>
474   </para>
475  </refsect1> 
476
477  <refsect1 id="config-include"><title>INCLUDE FACILITY</title>
478   <para>
479    The XML configuration may be partitioned into multiple files by using
480    the <literal>include</literal> element which takes a single attribute,
481    <literal>src</literal>. The of the <literal>src</literal> attribute is
482    regular Shell like glob-pattern. For example,
483    <screen><![CDATA[
484     <include src="/etc/pazpar2/conf.d/*.xml"/>
485     ]]></screen>
486   </para>
487   <para>
488    The include facility requires Pazpar2 version 1.2.
489   </para>
490  </refsect1>
491
492  <refsect1 id="target_settings"><title>TARGET SETTINGS</title>
493   <para>
494    Pazpar2 features a cunning scheme by which you can associate various
495    kinds of attributes, or settings with search targets. This can be done
496    through XML files which are read at startup; each file can associate
497    one or more settings with one or more targets. The file format is generic
498    in nature, designed to support a wide range of application requirements. The
499    settings can be purely technical things, like, how to perform a title
500    search against a given target, or it can associate arbitrary name=value
501    pairs with groups of targets -- for instance, if you would like to
502    place all commercial full-text bases in one group for selection
503    purposes, or you would like to control what targets are accessible
504    to users by default. Per-database settings values can even be used
505    to drive sorting, facet/termlist generation, or end-user interface display
506    logic.
507   </para>
508   
509   <para>
510    During startup, Pazpar2 will recursively read a specified directory
511    (can be identified in the pazpar2.cfg file or on the command line), and
512    process any settings files found therein.
513   </para>
514   
515   <para>
516    Clients of the Pazpar2 webservice interface can selectively override
517    settings for individual targets within the scope of one session. This
518    can be used in conjunction with an external authentication system to
519    determine which resources are to be accessible to which users. Pazpar2
520    itself has no notion of end-users, and so can be used in conjunction
521    with any type of authentication system. Similarly, the authentication
522    tokens submitted to access-controlled search targets can similarly be
523    overridden, to allow use of Pazpar2 in a consortial or multi-library
524    environment, where different end-users may need to be represented to
525    some search targets in different ways. This, again, can be managed
526    using an external database or other lookup mechanism. Setting overrides
527    can be performed either using the
528    <link linkend="command-init">init</link> or the 
529    <link linkend="command-settings">settings</link> webservice
530    command.
531   </para>
532   
533   <para>
534    In fact, every setting that applies to a database (except pz:id, which
535    can only be used for filtering targets to use for a search) can be overridden
536    on a per-session basis. This allows the client to override specific CCL fields
537    for searching, etc., to meet the needs of a session or user.
538   </para>
539   
540   <para>
541    Finally, as an extreme case of this, the webservice client can
542    introduce entirely new targets, on the fly, as part of the
543    <link linkend="command-init">init</link> or
544    <link linkend="command-settings">settings</link> command.
545    This is useful if you desire to manage information
546    about your search targets in a separate application such as a database.
547    You do not need any static settings file whatsoever to run Pazpar2 -- as
548    long as the webservice client is prepared to supply the necessary
549    information at the beginning of every session.
550   </para>
551   
552   <note>
553    <para>
554     The following discussion of practical issues related to session and settings
555     management are cast in terms of a user interface based on Ajax/Javascript
556     technology. It would apply equally well to many other kinds of browser-based logic.
557    </para>
558   </note>
559   
560   <para>
561    Typically, a Javascript client is not allowed to  directly alter the parameters
562    of a session. There are two reasons for this. One has to do with access
563    to information; typically, information about a user will be stored in a
564    system on the server side, or it will be accessible in some way from the server.
565    However, since the Javascript client cannot be entirely trusted (some hostile
566    agent might in fact 'pretend' to be a regular ws client), it is more robust
567    to control session settings from scripting that you run as part of your
568    webserver. Typically, this can be handled during the session initialization,
569    as follows:
570   </para>
571   
572   <para>
573    Step 1: The Javascript client loads, and asks the webserver for a new Pazpar2
574    session ID. This can be done using a Javascript call, for instance. Note that
575    it is possible to submit Ajax HTTPXmlRequest calls either to Pazpar2 or to the
576    webserver that Pazpar2 is proxying for. See (XXX Insert link to Pazpar2 protocol).
577     </para>
578   
579   <para>
580    Step 2: Code on the webserver authenticates the user, by database lookup,
581    LDAP access, NCIP, etc. Determines which resources the user has access to,
582    and any user-specific parameters that are to be applied during this session.
583   </para>
584   
585   <para>
586    Step 3: The webserver initializes a new Pazpar2 settings, and sets user-specific
587    parameters as necessary, using the init webservice command. A new session ID is
588    returned.
589   </para>
590   
591   <para>
592    Step 4: The webserver returns this session ID to the Javascript client, which then
593    uses the session ID to submit searches, show results, etc.
594   </para>
595   
596   <para>
597    Step 5: When the Javascript client ceases to use the session, Pazpar2 destroys
598    any session-specific information.
599   </para>
600
601   <refsect2><title>SETTINGS FILE FORMAT</title>
602    <para>
603     Each file contains a root element named &lt;settings&gt;. It may
604     contain one or more &lt;set&gt; elements. The settings and set
605     elements may contain the following attributes. Attributes in the set node
606     overrides those in the setting root element. Each set node must
607     specify (directly, or inherited from the parent node) at least a
608     target, name, and value.
609    </para>
610    
611    <variablelist> 
612     <varlistentry>
613      <term>target</term>
614      <listitem>
615       <para>
616        This specifies the search target to which this setting should be
617        applied. Targets are identified by their Z39.50 URL, generally
618        including the host, port, and database name, (e.g.
619        <literal>bagel.indexdata.com:210/marc</literal>).
620        Two wildcard forms are accepted:
621        * (asterisk) matches all known targets;
622        <literal>bagel.indexdata.com:210/*</literal> matches all
623        known databases on the given host.
624       </para>
625       <para>
626        A precedence system determines what happens if there are
627        overlapping values for the same setting name for the same
628        target. A setting for a specific target name overrides a
629        setting which specifies target using a wildcard. This makes it
630        easy to set defaults for all targets, and then override them
631        for specific targets or hosts. If there are
632        multiple overlapping settings with the same name and target
633        value, the 'precedence' attribute determines what happens.
634       </para>
635      </listitem>
636     </varlistentry>
637     <varlistentry>
638      <term>name</term>
639      <listitem>
640       <para>
641        The name of the setting. This can be anything you like.
642        However, Pazpar2 reserves a number of setting names for
643        specific purposes, all starting with 'pz:', and it is a good
644        idea to avoid that prefix if you make up your own setting
645        names. See below for a list of reserved variables.
646       </para>
647      </listitem>
648     </varlistentry>
649     <varlistentry>
650      <term>value</term>
651      <listitem>
652       <para>
653        The value of the setting. Generally, this can be anything you
654        want -- however, some of the reserved settings may expect
655        specific kinds of values.
656       </para>
657      </listitem>
658     </varlistentry>
659     <varlistentry>
660      <term>precedence</term>
661      <listitem>
662       <para>
663        This should be an integer. If not provided, the default value
664        is 0. If two (or more) settings have the same content for
665        target and name, the precedence value determines the outcome.
666        If both settings have the same precedence value, they are both
667        applied to the target(s). If one has a higher value, then the
668        value of that setting is applied, and the other one is ignored.
669       </para>
670      </listitem>
671     </varlistentry>
672    </variablelist>
673    
674    <para>
675     By setting defaults for target, name, or value in the root
676     settings node, you can use the settings files in many different
677     ways. For instance, you can use a single file to set defaults for
678     many different settings, like search fields, retrieval syntaxes,
679     etc. You can have one file per server, which groups settings for
680     that server or target. You could also have one file which associates
681     a number of targets with a given setting, for instance, to associate
682     many databases with a given category or class that makes sense
683     within your application.
684    </para>
685    
686    <para>
687     The following examples illustrate uses of the settings system to
688     associate settings with targets to meet different requirements.
689    </para>
690    
691    <para>
692     The example below associates a set of default values that can be
693     used across many targets. Note the wildcard for targets.
694     This associates the given settings with all targets for which no
695     other information is provided.
696     <screen><![CDATA[
697 <settings target="*">
698
699   <!-- This file introduces default settings for pazpar2 -->
700
701   <!-- mapping for unqualified search -->
702   <set name="pz:cclmap:term" value="u=1016 t=l,r s=al"/>
703
704   <!-- field-specific mappings -->
705   <set name="pz:cclmap:ti" value="u=4 s=al"/>
706   <set name="pz:cclmap:su" value="u=21 s=al"/>
707   <set name="pz:cclmap:isbn" value="u=7"/>
708   <set name="pz:cclmap:issn" value="u=8"/>
709   <set name="pz:cclmap:date" value="u=30 r=r"/>
710
711   <!-- Retrieval settings -->
712
713   <set name="pz:requestsyntax" value="marc21"/>
714   <set name="pz:elements" value="F"/>
715
716   <!-- Query encoding -->
717   <set name="pz:queryencoding" value="iso-8859-1"/>
718
719   <!-- Result normalization settings -->
720
721   <set name="pz:nativesyntax" value="iso2709"/>
722   <set name="pz:xslt" value="../etc/marc21.xsl"/>
723
724 </settings>
725
726         ]]></screen>
727    </para>
728    
729    <para>
730     The next example shows certain settings overridden for one target,
731     one which returns XML records containing DublinCore elements, and
732     which furthermore requires a username/password.
733     <screen><![CDATA[
734 <settings target="funkytarget.com:210/db1">
735   <set name="pz:requestsyntax" value="xml"/>
736   <set name="pz:nativesyntax" value="xml"/>
737   <set name="pz:xslt" value="../etc/dublincore.xsl"/>
738
739   <set name="pz:authentication" value="myuser/password"/>
740 </settings>
741         ]]></screen>
742    </para>
743    
744    <para>
745     The following example associates a specific name/value combination
746     with a number of targets. The targets below are access-restricted,
747     and can only be used by users with special credentials.
748     <screen><![CDATA[
749 <settings name="pz:allow" value="0">
750   <set target="funkytarget.com:210/*"/>
751   <set target="commercial.com:2100/expensiveDb"/>
752 </settings>
753         ]]></screen>
754    </para>
755    
756   </refsect2>
757   
758   <refsect2><title>RESERVED SETTING NAMES</title>
759    <para>
760     The following setting names are reserved by Pazpar2 to control the
761     behavior of the client function.
762    </para>
763    
764    <variablelist>
765     <varlistentry>
766      <term>pz:cclmap:xxx</term>
767      <listitem>
768       <para>
769        This establishes a CCL field definition or other setting, for
770        the purpose of mapping end-user queries. XXX is the field or
771        setting name, and the value of the setting provides parameters
772        (e.g. parameters to send to the server, etc.). Please consult
773        the YAZ manual for a full overview of the many capabilities of
774        the powerful and flexible CCL parser.
775       </para>
776       <para>
777        Note that it is easy to establish a set of default parameters,
778        and then override them individually for a given target.
779       </para>
780      </listitem>
781     </varlistentry>
782     <varlistentry>
783      <term>pz:requestsyntax</term>
784      <listitem>
785       <para>
786        This specifies the record syntax to use when requesting
787        records from a given server. The value can be a symbolic name like
788        marc21 or xml, or it can be a Z39.50-style dot-separated OID.
789       </para>
790      </listitem>
791     </varlistentry>
792     <varlistentry>
793      <term>pz:elements</term>
794      <listitem>
795       <para>
796        The element set name to be used when retrieving records from a
797        server.
798       </para>
799      </listitem>
800     </varlistentry>
801     <varlistentry>
802      <term>pz:piggyback</term>
803      <listitem>
804       <para>
805        Piggybacking enables the server to retrieve records from the
806        server as part of the search response in Z39.50. Almost all
807        servers support this (or fail it gracefully), but a few
808        servers will produce undesirable results.
809        Set to '1' to enable piggybacking, '0' to disable it. Default
810        is 1 (piggybacking enabled).
811       </para>
812      </listitem>
813     </varlistentry>
814     <varlistentry>
815      <term>pz:nativesyntax</term>
816      <listitem>
817       <para>
818        The representation (syntax) of the retrieval records. Currently
819        recognized values are iso2709 and xml.
820       </para>
821       <para>
822        For iso2709, can also specify a native character set, e.g. "iso2709;latin-1".
823        If no character set is provided, MARC-8 is assumed.
824       </para>
825       <para>
826         If pz:nativesyntax is not specified, pazpar2 will attempt to determine
827         the value based on the response from the server.
828       </para>
829      </listitem>
830     </varlistentry>
831
832     <varlistentry>
833      <term>pz:queryencoding</term>
834      <listitem>
835       <para>
836         The encoding of the search terms that a target accepts. Most
837         targets do not honor UTF-8 in which case this needs to be specified.
838         Each term in a query will be converted if this setting is given.
839       </para>
840      </listitem>
841     </varlistentry>
842
843     <varlistentry>
844      <term>pz:xslt</term>
845      <listitem>
846       <para>
847        Provides the path of an XSLT stylesheet which will be used to
848        map incoming records to the internal representation.
849       </para>
850       <para>
851        When mapping MARC XML records, XSLT can be bypassed for increased 
852        performance with the alternate "MARC map" format.  Provide the
853        path of a file with extension ".mmap" containing on each line:
854        <programlisting>
855         &lt;field&gt; &lt;subfield&gt; &lt;metadata element&gt;</programlisting>
856        For example:
857        <programlisting>
858         245 a title
859         500 $ description
860         773 * citation</programlisting>
861        To map the field value specify a subfield of '$'.  To store a 
862        concatenation of all subfields, specify a subfield of '*'.
863       </para>
864      </listitem>
865     </varlistentry>
866     <varlistentry>
867      <term>pz:authentication</term>
868      <listitem>
869       <para>
870        Sets an authentication string for a given server. See the section on
871        authorization and authentication for discussion.
872       </para>
873      </listitem>
874     </varlistentry>
875     <varlistentry>
876      <term>pz:allow</term>
877      <listitem>
878       <para>
879        Allows or denies access to the resources it is applied to. Possible
880        values are '0' and '1'. The default is '1' (allow access to this resource).
881        See the manual section on authorization and authentication for discussion
882        about how to use this setting.
883       </para>
884      </listitem>
885     </varlistentry>
886     <varlistentry>
887      <term>pz:maxrecs</term>
888      <listitem>
889       <para>
890        Controls the maximum number of records to be retrieved from a
891        server. The default is 100.
892       </para>
893      </listitem>
894     </varlistentry>
895     <varlistentry>
896      <term>pz:id</term>
897      <listitem>
898       <para>
899        This setting can't be 'set' -- it contains the ID (normally
900        ZURL) for a given target, and is useful for filtering --
901        specifically when you want to select one or more specific
902        targets in the search command.
903       </para>
904      </listitem>
905     </varlistentry>
906     <varlistentry>
907      <term>pz:zproxy</term>
908      <listitem>
909       <para>
910        The 'pz:zproxy' setting has the value syntax 
911        'host.internet.adress:port', it is used to tunnel Z39.50
912        requests through the named Z39.50 proxy.
913       </para>
914      </listitem>
915     </varlistentry>
916     
917     <varlistentry>
918      <term>pz:apdulog</term>
919      <listitem>
920       <para>
921        If the 'pz:apdulog' setting is defined and has other value than 0,
922        then Z39.50 APDUs are written to the log.
923       </para>
924      </listitem>
925     </varlistentry>
926     
927     <varlistentry>
928      <term>pz:sru</term>
929      <listitem>
930       <para>
931        This setting enables SRU/SRW support. It has three possible settings.
932        'get', enables SRU access through GET requests. 'post' enables SRU/POST
933        support, less commonly supported, but useful if very large requests are
934        to be submitted. 'srw' enables the SRW variation of the protocol.
935       </para>
936      </listitem>
937     </varlistentry>
938     
939     <varlistentry>
940      <term>pz:sru_version</term>
941      <listitem>
942       <para>
943        This allows SRU version to be specified. If unset Pazpar2
944        will the default of YAZ (currently 1.2). Should be set
945        to 1.1 or 1.2.
946       </para>
947      </listitem>
948     </varlistentry>
949     
950     <varlistentry>
951      <term>pz:pqf_prefix</term>
952      <listitem>
953       <para>
954        Allows you to specify an arbitrary PQF query language substring.
955        The provided string is prefixed the user's query after it has been
956        normalized to PQF internally in pazpar2.
957        This allows you to attach complex 'filters' to queries for a given
958        target, sometimes necessary to select sub-catalogs
959        in union catalog systems, etc.
960       </para>
961      </listitem>
962     </varlistentry>
963     
964     <varlistentry>
965      <term>pz:sort</term>
966      <listitem>
967       <para>
968        Specifies sort criteria to be applied to the result set.
969        Only works for targets which support the sort service.
970       </para>
971      </listitem>
972     </varlistentry>
973    </variablelist>
974   </refsect2>
975   
976  </refsect1>
977  <refsect1><title>SEE ALSO</title>
978   <para>
979    <citerefentry>
980     <refentrytitle>pazpar2</refentrytitle>
981     <manvolnum>8</manvolnum>
982    </citerefentry>
983    <citerefentry>
984     <refentrytitle>yaz-icu</refentrytitle>
985     <manvolnum>1</manvolnum>
986    </citerefentry>
987    <citerefentry>
988     <refentrytitle>pazpar2_protocol</refentrytitle>
989     <manvolnum>7</manvolnum>
990    </citerefentry>
991   </para>
992  </refsect1>
993 </refentry>
994 <!-- Keep this comment at the end of the file
995 Local variables:
996 mode: sgml
997 sgml-omittag:t
998 sgml-shorttag:t
999 sgml-minimize-attributes:nil
1000 sgml-always-quote-attributes:t
1001 sgml-indent-step:1
1002 sgml-indent-data:t
1003 sgml-parent-document:nil
1004 sgml-local-catalogs: nil
1005 sgml-namecase-general:t
1006 End:
1007 -->