635a8ba542cb0966fac2601e421aac1d003f4148
[pazpar2-moved-to-github.git] / doc / pazpar2_conf.xml
1 <?xml version="1.0" standalone="no"?>
2 <!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook V4.4//EN"
3  "http://www.oasis-open.org/docbook/xml/4.4/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   <info><orgname>Index Data</orgname></info>
17  </refentryinfo>
18
19  <refmeta>
20   <refentrytitle>Pazpar2 conf</refentrytitle>
21   <manvolnum>5</manvolnum>
22   <refmiscinfo class="manual">File formats and conventions</refmiscinfo>
23  </refmeta>
24
25  <refnamediv>
26   <refname>pazpar2_conf</refname>
27   <refpurpose>Pazpar2 Configuration</refpurpose>
28  </refnamediv>
29
30  <refsynopsisdiv>
31   <cmdsynopsis>
32    <command>pazpar2.conf</command>
33   </cmdsynopsis>
34  </refsynopsisdiv>
35
36  <refsect1>
37   <title>DESCRIPTION</title>
38   <para>
39    The Pazpar2 configuration file, together with any referenced XSLT files,
40    govern Pazpar2's behavior as a client, and control the normalization and
41    extraction of data elements from incoming result records, for the
42    purposes of merging, sorting, facet analysis, and display.
43   </para>
44
45   <para>
46    The file is specified using the option -f on the Pazpar2 command line.
47    There is not presently a way to reload the configuration file without
48    restarting Pazpar2, although this will most likely be added some time
49    in the future.
50   </para>
51  </refsect1>
52
53  <refsect1>
54   <title>FORMAT</title>
55   <para>
56    The configuration file is XML-structured. It must be well-formed XML. All
57    elements specific to Pazpar2 should belong to the namespace
58    <literal>http://www.indexdata.com/pazpar2/1.0</literal>
59    (this is assumed in the
60    following examples). The root element is named "<literal>pazpar2</literal>".
61    Under the  root element are a number of elements which group categories of
62    information. The categories are described below.
63   </para>
64
65   <refsect2 id="config-threads">
66    <title>threads</title>
67    <para>
68     This section is optional and is supported for Pazpar2 version 1.3.1 and
69     later . It is identified by element "<literal>threads</literal>" which
70     may include one attribute "<literal>number</literal>" which specifies
71     the number of worker-threads that the Pazpar2 instance is to use.
72     A value of 0 (zero) disables worker-threads (all work is carried out
73     in main thread).
74    </para>
75   </refsect2>
76   <refsect2 id="config-file">
77    <title>file</title>
78    <para>
79     This configuration takes one attribute <literal>path</literal> which
80     specifies a path to search for local files, such as XSLTs  and settings.
81     The path is a colon separated list of directories. Its default value
82     is "<literal>.</literal>" which is equivalent to the location of the
83     main configuration file (where indeed the file element is given).
84    </para>
85   </refsect2>
86   <refsect2 id="config-server">
87    <title>server</title>
88    <para>
89     This section governs overall behavior of a server endpoint. It is identified
90     by the element "server" which takes an optional attribute, "id", which
91     identifies this particular Pazpar2 server. Any string value for "id"
92     may be given.
93    </para>
94    <para>
95     The data
96     elements are described below. From Pazpar2 version 1.2 this is
97     a repeatable element.
98    </para>
99    <variablelist> <!-- level 1 -->
100     <varlistentry>
101      <term>listen</term>
102      <listitem>
103       <para>
104        Configures the webservice -- this controls how you can connect
105        to Pazpar2 from your browser or server-side code. The
106        attributes 'host' and 'port' control the binding of the
107        server. The 'host' attribute can be used to bind the server to
108        a secondary IP address of your system, enabling you to run
109        Pazpar2 on port 80 alongside a conventional web server. You
110        can override this setting on the command line using the option -h.
111       </para>
112      </listitem>
113     </varlistentry>
114
115     <varlistentry>
116      <term>proxy</term>
117      <listitem>
118       <para>
119        If this item is given, Pazpar2 will forward all incoming HTTP
120        requests that do not contain the filename 'search.pz2' to the
121        host and port specified using the 'host' and 'port'
122        attributes. The 'myurl' attribute is required, and should provide
123        the base URL of the server. Generally, the HTTP URL for the host
124        specified in the 'listen' parameter. This functionality is
125        crucial if you wish to use
126        Pazpar2 in conjunction with browser-based code (JS, Flash,
127        applets, etc.) which operates in a security sandbox. Such code
128        can only connect to the same server from which the enclosing
129        HTML page originated. Pazpar2s proxy functionality enables you
130        to host all of the main pages (plus images, CSS, etc) of your
131        application on a conventional webserver, while efficiently
132        processing webservice requests for metasearch status, results,
133        etc.
134       </para>
135      </listitem>
136     </varlistentry>
137
138     <varlistentry>
139      <term>icu_chain</term>
140      <listitem>
141       <para>
142        Specifies character set normalization for relevancy / sorting /
143        mergekey and facets - for the server. These definitions serves as
144        default for services that don't have these given. For the meaning
145        of these settings refer to the
146        <xref linkend="icuchain"/> element inside service.
147       </para>
148      </listitem>
149     </varlistentry>
150
151     <varlistentry>
152      <term>relevance / sort / mergekey / facet</term>
153      <listitem>
154       <para>
155        Obsolete. Use element icu_chain instead.
156       </para>
157      </listitem>
158     </varlistentry>
159
160     <varlistentry>
161      <term>settings</term>
162      <listitem>
163       <para>
164        Specifies target settings for the server.. These settings serves
165        as default for all services which don't have these given.
166        The settings element requires one attribute 'src' which specifies
167        a settings file or a directory . If a directory is given all
168        files with suffix <filename>.xml</filename> is read from this
169        directory. Refer to
170        <xref linkend="target_settings"/> for more information.
171       </para>
172      </listitem>
173     </varlistentry>
174
175     <varlistentry>
176      <term id="service_conf">service</term>
177      <listitem>
178       <para>
179        This nested element controls the behavior of Pazpar2 with
180        respect to your data model. In Pazpar2, incoming records are
181        normalized, using XSLT, into an internal representation.
182        The 'service' section controls the further processing and
183        extraction of data from the internal representation, primarily
184        through the 'metadata' sub-element.
185       </para>
186       <para>
187        Pazpar2 version 1.2 and later allows multiple service elements.
188        Multiple services must be given a unique ID by specifying
189        attribute <literal>id</literal>.
190        A single service may be unnamed (service ID omitted). The
191        service ID is referred to in the
192        <link linkend="command-init"><literal>init</literal></link> webservice
193        command's <literal>service</literal> parameter.
194       </para>
195
196       <variablelist> <!-- Level 2 -->
197        <varlistentry>
198         <term>metadata</term>
199         <listitem>
200          <para>
201           One of these elements is required for every data element in
202           the internal representation of the record (see
203           <xref linkend="data_model"/>. It governs
204           subsequent processing as pertains to sorting, relevance
205           ranking, merging, and display of data elements. It supports
206           the following attributes:
207          </para>
208
209          <variablelist> <!-- level 3 -->
210           <varlistentry>
211            <term>name</term>
212            <listitem>
213             <para>
214              This is the name of the data element. It is matched
215              against the 'type' attribute of the
216              'metadata' element
217              in the normalized record. A warning is produced if
218              metadata elements with an unknown name are
219              found in the
220              normalized record. This name is also used to
221              represent
222              data elements in the records returned by the
223              webservice API, and to name sort lists and browse
224              facets.
225             </para>
226            </listitem>
227           </varlistentry>
228
229           <varlistentry>
230            <term>type</term>
231            <listitem>
232             <para>
233              The type of data element. This value governs any
234              normalization or special processing that might take
235              place on an element. Possible values are 'generic'
236              (basic string), 'year' (a range is computed if
237              multiple years are found in the record). Note: This
238              list is likely to increase in the future.
239             </para>
240            </listitem>
241           </varlistentry>
242
243           <varlistentry>
244            <term>brief</term>
245            <listitem>
246             <para>
247              If this is set to 'yes', then the data element is
248              includes in brief records in the webservice API. Note
249              that this only makes sense for metadata elements that
250              are merged (see below). The default value is 'no'.
251             </para>
252            </listitem>
253           </varlistentry>
254
255           <varlistentry>
256            <term>sortkey</term>
257            <listitem>
258             <para>
259              Specifies that this data element is to be used for
260              sorting. The possible values are 'numeric' (numeric
261              value), 'skiparticle' (string; skip common, leading
262              articles), and 'no' (no sorting). The default value is
263              'no'.
264             </para>
265             <para>
266              When 'skiparticle' is used, some common articles from the
267              English and German languages are ignored. At present the
268              list is: 'the', 'den', 'der', 'die', 'des', 'an', 'a'.
269             </para>
270            </listitem>
271           </varlistentry>
272
273           <varlistentry>
274            <term id="metadata-rank">rank</term>
275            <listitem>
276             <para>
277              Specifies that this element is to be used to
278              help rank
279              records against the user's query (when ranking is
280              requested).
281              The valus is of the form
282              <literallayout>
283               M [F N]
284              </literallayout>
285              where M is an integer, used as a
286              weight against the basic TF*IDF score. A value of
287              1 is the base, higher values give additional weight to
288              elements of this type. The default is '0', which
289              excludes this element from the rank calculation.
290             </para>
291             <para>
292              F is a CCL field and N is the multipler for terms
293              that matches those part of the CCL field in search.
294              The F+N combo allows the system to use a different
295              multipler for a certain field. For example, a rank value of
296              "<literal>1 au 3</literal>" gives a multipler of 3 for
297              all terms part of the au(thor) terms and 1 for everything else.
298             </para>
299             <para>
300              For Pazpar2 1.6.13 and later, the rank may also defined
301              "per-document", by the normalization stylesheet.
302             </para>
303             <para>
304              The per field rank was introduced in Pazpar2 1.6.15. Earlier
305              releases only allowed a rank value M (simple integer).
306             </para>
307             See <xref linkend="relevance_ranking"/> for more
308             about ranking.
309            </listitem>
310           </varlistentry>
311
312           <varlistentry>
313            <term>termlist</term>
314            <listitem>
315             <para>
316              Specifies that this element is to be used as a
317              termlist, or browse facet. Values are tabulated from
318              incoming records, and a highscore of values (with
319              their associated frequency) is made available to the
320              client through the webservice API.
321              The possible values
322              are 'yes' and 'no' (default).
323             </para>
324            </listitem>
325           </varlistentry>
326
327           <varlistentry>
328            <term>merge</term>
329            <listitem>
330             <para>
331              This governs whether, and how elements are extracted
332              from individual records and merged into cluster
333              records. The possible values are: 'unique' (include
334              all unique elements), 'longest' (include only the
335              longest element (strlen), 'range' (calculate a range
336              of values across all matching records), 'all' (include
337              all elements), or 'no' (don't merge; this is the
338              default);
339             </para>
340             <para>
341              Pazpar 1.6.24 also offers a new value for merge, 'first', which
342              is like 'all' but only takes all from first database that returns
343              the particular metadata field.
344             </para>
345            </listitem>
346           </varlistentry>
347
348           <varlistentry>
349            <term>mergekey</term>
350            <listitem>
351             <para>
352              If set to '<literal>required</literal>', the value of this
353              metadata element is appended to the resulting mergekey if
354              the metadata is present in a record instance.
355              If the metadata element is not present, the a unique mergekey
356              will be generated instead.
357             </para>
358             <para>
359              If set to '<literal>optional</literal>', the value of this
360              metadata element is appended to the resulting mergekey if the
361              the metadata is present in a record instance. If the metadata
362              is not present, it will be empty.
363             </para>
364             <para>
365              If set to '<literal>no</literal>' or the mergekey attribute is
366              omitted, the metadata will not be used in the creation of a
367              mergekey.
368             </para>
369            </listitem>
370           </varlistentry>
371
372           <varlistentry>
373            <term id="facetrule">facetrule</term>
374            <listitem>
375             <para>
376              Specifies the ICU rule set to be used for normalizing
377              facets. If facetrule is omitted from metadata, the
378              rule set 'facet' is used.
379             </para>
380            </listitem>
381           </varlistentry>
382
383           <varlistentry>
384            <term id="limitcluster">limitcluster</term>
385            <listitem>
386             <para>
387              Allow a limit on merged metadata. The value of this attribute
388              is the name of actual metadata content to be used for matching
389              (most often same name as metadata name).
390             </para>
391             <note>
392              <para>
393               Requires Pazpar2 1.6.23 or later.
394              </para>
395             </note>
396            </listitem>
397           </varlistentry>
398
399           <varlistentry>
400            <term id="metadata_limitmap">limitmap</term>
401            <listitem>
402             <para>
403              Specifies a default limitmap for this field. This is to avoid mass
404              configuring of targets. However it is important to review/do
405              this on a per target since it is usually target-specific.
406              See limitmap for format.
407             </para>
408            </listitem>
409           </varlistentry>
410
411           <varlistentry>
412            <term id="metadata_facetmap">facetmap</term>
413            <listitem>
414             <para>
415              Specifies a default facetmap for this field. This is to avoid mass
416              configuring of targets. However it is important to review/do
417              this on a per target since it is usually target-specific.
418              See facetmap for format.
419             </para>
420            </listitem>
421           </varlistentry>
422
423           <varlistentry>
424            <term id="icurule">icurule</term>
425            <listitem>
426             <para>
427              Specifies the ICU rule set to be used for normalizing
428              metadata text. The "display" part of the rule is kept
429              in the returned metadata record (record+show commands), the
430              end result - normalized text - is used for performing
431              within-cluster merge (unique, longest, etc). If the icurule is
432              omitted, type generic (text) is converted as follows:
433              any of the characters "<literal> ,/.:([</literal>" are
434              chopped of prefix and suffix of text content
435              <emphasis>unless</emphasis> it includes the
436              characters "<literal>://</literal>" (URL).
437             </para>
438             <note>
439              <para>
440               Requires Pazpar2 1.9.0 or later.
441              </para>
442             </note>
443            </listitem>
444           </varlistentry>
445
446           <varlistentry>
447            <term>setting</term>
448            <listitem>
449             <para>
450              This attribute allows you to make use of static database
451              settings in the processing of records. Three possible values
452              are allowed. 'no' is the default and doesn't do anything.
453              'postproc' copies the value of a setting with the same name
454              into the output of the normalization stylesheet(s). 'parameter'
455              makes the value of a setting with the same name available
456              as a parameter to the normalization stylesheet, so you
457              can further process the value inside of the stylesheet, or use
458              the value to decide how to deal with other data values.
459             </para>
460             <para>
461              The purpose of using settings in this way can either be to
462              control the behavior of normalization stylesheet in a database-
463              dependent way, or to easily make database-dependent values
464              available to display-logic in your user interface, without having
465              to implement complicated interactions between the user interface
466              and your configuration system.
467             </para>
468            </listitem>
469           </varlistentry>
470
471          </variablelist> <!-- attributes to metadata -->
472
473         </listitem>
474        </varlistentry>
475
476        <varlistentry>
477         <term id="servicexslt" xreflabel="xslt">xslt</term>
478         <listitem>
479          <para>
480           Defines a XSLT stylesheet. The <literal>xslt</literal>
481           element takes exactly one attribute <literal>id</literal>
482           which names the stylesheet. This can be referred to in target
483           settings <xref linkend="pzxslt"/>.
484          </para>
485          <para>
486           The content of the xslt element is the embedded stylesheet XML
487          </para>
488         </listitem>
489        </varlistentry>
490        <varlistentry>
491         <term id="icuchain" xreflabel="icu_chain">icu_chain</term>
492         <listitem>
493          <para>
494           Specifies a named ICU rule set. The icu_chain element must include
495           attribute 'id' which specifies the identifier (name) for the ICU
496           rule set.
497           Pazpar2 uses the particular rule sets for particular purposes.
498           Rule set 'relevance' is used to normalize
499           terms for relevance ranking. Rule set 'sort' is used to
500           normalize terms for sorting. Rule set 'mergekey' is used to
501           normalize terms for making a mergekey and, finally. Rule set 'facet'
502           is normally used to normalize facet terms, unless
503           <xref linkend="facetrule">facetrule</xref> is given for a
504           metadata field.
505          </para>
506          <para>
507           The icu_chain element must also include a 'locale'
508           attribute which must be set to one of the locale strings
509           defined in ICU. The child elements listed below can be
510           in any order, except the 'index' element which logically
511           belongs to the end of the list. The stated tokenization,
512           transformation and charmapping instructions are performed
513           in order from top to bottom.
514          </para>
515          <variablelist> <!-- Level 2 -->
516           <varlistentry>
517            <term>casemap</term>
518            <listitem>
519             <para>
520              The attribute 'rule' defines the direction of the
521              per-character casemapping, allowed values are "l"
522              (lower), "u" (upper), "t" (title).
523             </para>
524            </listitem>
525           </varlistentry>
526           <varlistentry>
527            <term>transform</term>
528            <listitem>
529             <para>
530              Normalization and transformation of tokens follows
531              the rules defined in the 'rule' attribute. For
532              possible values we refer to the extensive ICU
533              documentation found at the
534              <ulink url="&url.icu.transform;">ICU
535              transformation</ulink> home page. Set filtering
536              principles are explained at the
537              <ulink url="&url.icu.unicode.set;">ICU set and
538              filtering</ulink> page.
539             </para>
540            </listitem>
541           </varlistentry>
542           <varlistentry>
543            <term>tokenize</term>
544            <listitem>
545             <para>
546              Tokenization is the only rule in the ICU chain
547              which splits one token into multiple tokens. The
548              'rule' attribute may have the following values:
549              "s" (sentence), "l" (line-break), "w" (word), and
550              "c" (character), the later probably not being
551              very useful in a pruning Pazpar2 installation.
552             </para>
553            </listitem>
554           </varlistentry>
555          </variablelist>
556          <para>
557           From Pazpar2 version 1.1 the ICU wrapper from YAZ is used.
558           Refer to the <ulink url="&url.yaz.yaz-icu;">yaz-icu</ulink>
559           utility for more information.
560          </para>
561         </listitem>
562        </varlistentry>
563
564        <varlistentry>
565         <term>relevance</term>
566         <listitem>
567          <para>
568           Specifies the ICU rule set used for relevance ranking.
569           The child element of 'relevance' must be 'icu_chain' and the
570           'id' attribute of the icu_chain is ignored. This
571           definition is obsolete and should be replaced by the equivalent
572           construct:
573           <screen>
574            &lt;icu_chain id="relevance" locale="en">..&lt;icu_chain>
575           </screen>
576          </para>
577         </listitem>
578        </varlistentry>
579
580        <varlistentry>
581         <term>sort</term>
582         <listitem>
583          <para>
584           Specifies the ICU rule set used for sorting.
585           The child element of 'sort' must be 'icu_chain' and the
586           'id' attribute of the icu_chain is ignored. This
587           definition is obsolete and should be replaced by the equivalent
588           construct:
589           <screen>
590            &lt;icu_chain id="sort" locale="en">..&lt;icu_chain>
591           </screen>
592          </para>
593         </listitem>
594        </varlistentry>
595
596        <varlistentry>
597         <term>mergekey</term>
598         <listitem>
599          <para>
600           Specifies ICU tokenization and transformation rules
601           for tokens that are used in Pazpar2's mergekey.
602           The child element of 'mergekey' must be 'icu_chain' and the
603           'id' attribute of the icu_chain is ignored. This
604           definition is obsolete and should be replaced by the equivalent
605           construct:
606           <screen>
607            &lt;icu_chain id="mergekey" locale="en">..&lt;icu_chain>
608           </screen>
609          </para>
610         </listitem>
611        </varlistentry>
612
613        <varlistentry>
614         <term>facet</term>
615         <listitem>
616          <para>
617           Specifies ICU tokenization and transformation rules
618           for tokens that are used in Pazpar2's facets.
619           The child element of 'facet' must be 'icu_chain' and the
620           'id' attribute of the icu_chain is ignored. This
621           definition is obsolete and should be replaced by the equivalent
622           construct:
623           <screen>
624            &lt;icu_chain id="facet" locale="en">..&lt;icu_chain>
625           </screen>
626          </para>
627         </listitem>
628        </varlistentry>
629
630        <varlistentry>
631         <term>ccldirective</term>
632         <listitem>
633          <para>
634           Customizes the CCL parsing (interpretation of query parameter
635           in search).
636           The name and value of the CCL directive is gigen by attributes
637           'name' and 'value' respectively. Refer to possible list of names
638           in the
639           <ulink
640               url="http://www.indexdata.com/yaz/doc/tools.html#ccl.directives.table">
641            YAZ manual
642            </ulink>.
643          </para>
644         </listitem>
645        </varlistentry>
646
647        <varlistentry id="service-rank">
648         <term>rank</term>
649         <listitem>
650          <para>
651           Customizes the ranking (relevance) algorithm. Also known as
652           rank tweaks. The rank element
653           accepts the following attributes - all being optional:
654          </para>
655          <variablelist>
656           <varlistentry>
657            <term>cluster</term>
658            <listitem>
659             <para>
660              Attribute 'cluster' is a boolean
661              that controls whether Pazpar2 should boost ranking for merged
662              records. Is 'yes' by default. A value of 'no' will make
663              Pazpar2 average ranking of each record in a cluster.
664             </para>
665            </listitem>
666           </varlistentry>
667           <varlistentry>
668            <term>debug</term>
669            <listitem>
670             <para>
671              Attribute 'debug' is a boolean
672              that controls whether Pazpar2 should include details
673              about ranking for each document in the show command's
674              response. Enable by using value "yes", disable by using
675              value "no" (default).
676             </para>
677            </listitem>
678           </varlistentry>
679           <varlistentry>
680            <term>follow</term>
681            <listitem>
682             <para>
683              Attribute 'follow' is a a floating point number greater than
684              or equal to 0. A positive number will boost weight for terms
685              that occur close to each other (proximity, distance).
686              A value of 1, will double the weight if two terms are in
687              proximity distance of 1 (next to each other). The default
688              value of 'follow' is 0 (order will not affect weight).
689             </para>
690            </listitem>
691           </varlistentry>
692           <varlistentry>
693            <term>lead</term>
694            <listitem>
695             <para>
696              Attribute 'lead' is a floating point number.
697              It controls if term weight should be reduced by position
698              from start in a metadata field. A positive value of 'lead'
699              will reduce weight as it apperas further away from the lead
700              of the field. Default value is 0 (no reduction of weight by
701              position).
702             </para>
703            </listitem>
704           </varlistentry>
705           <varlistentry>
706            <term>length</term>
707            <listitem>
708             <para>
709              Attribute 'length' determines how/if term weight should be
710              divided by lenght of metadata field. A value of "linear"
711              divide by length. A value of "log" will divide by log2(length).
712              A value of "none" will leave term weight as is (no division).
713              Default value is "linear".
714             </para>
715            </listitem>
716           </varlistentry>
717          </variablelist>
718          <para>
719           Refer to <xref linkend="relevance_ranking"/> to see how
720           these tweaks are used in computation of score.
721          </para>
722          <para>
723           Customization of ranking algorithm was introduced with
724           Pazpar2 1.6.18. The semantics of some of the fields changed
725           in versions up to 1.6.22.
726          </para>
727         </listitem>
728        </varlistentry>
729
730        <varlistentry id="sort-default">
731         <term>sort-default</term>
732         <listitem>
733          <para>
734           Specifies the default sort criteria (default 'relevance'),
735           which previous was hard-coded as default criteria in search.
736           This is a fix/work-around to avoid re-searching when using
737           target-based sorting. In order for this to work efficient,
738           the search must also have the sort critera parameter; otherwise
739           pazpar2 will do re-searching on search criteria changes, if
740           changed between search and show command.
741          </para>
742          <para>
743           This configuration was added in pazpar2 1.6.20.
744          </para>
745         </listitem>
746        </varlistentry>
747
748 <!--
749        <varlistentry>
750         <term>set</term>
751         <listitem>
752          <para>
753           Specifies a variable that will be inherited by all targets defined in settings
754           <screen>
755            &lt;set name="test" value="en"..&lt;set>
756           </screen>
757          </para>
758         </listitem>
759        </varlistentry>
760 -->
761        <varlistentry>
762         <term>settings</term>
763         <listitem>
764          <para>
765           Specifies target settings for this service. Refer to
766           <xref linkend="target_settings"/>.
767          </para>
768         </listitem>
769        </varlistentry>
770
771        <varlistentry id="service-timeout">
772         <term>timeout</term>
773         <listitem>
774          <para>
775           Specifies timeout parameters for this service.
776           The <literal>timeout</literal>
777           element supports the following attributes:
778           <literal>session</literal>, <literal>z3950_operation</literal>,
779           <literal>z3950_session</literal> which specifies
780           'session timeout', 'Z39.50 operation timeout',
781           'Z39.50 session timeout' respectively. The Z39.50 operation
782           timeout is the time Pazpar2 will wait for an active Z39.50/SRU
783           operation before it gives up (times out). The Z39.50 session
784           time out is the time Pazpar2 will keep the session alive for
785           an idle session (no operation).
786          </para>
787          <para>
788           The following is recommended but not required:
789           z3950_operation (30) &lt; session (60) &lt; z3950_session (180) .
790           The default values are given in parantheses.
791          </para>
792          <para>
793           The Z39.50 operation timeout may be set per database. Refer to
794           <xref linkend="pztimeout"/>.
795          </para>
796         </listitem>
797        </varlistentry>
798       </variablelist>     <!-- Data elements in service directive -->
799      </listitem>
800     </varlistentry>
801    </variablelist>           <!-- Data elements in server directive -->
802   </refsect2>
803  </refsect1>
804
805  <refsect1>
806   <title>EXAMPLE</title>
807   <para>
808    Below is a working example configuration:
809   </para>
810   <screen>
811    <![CDATA[
812 <?xml version="1.0" encoding="UTF-8"?>
813 <pazpar2 xmlns="http://www.indexdata.com/pazpar2/1.0">
814
815  <threads number="10"/>
816  <server>
817   <listen port="9004"/>
818   <service>
819    <rank debug="yes"/>
820    <metadata name="title" brief="yes" sortkey="skiparticle"
821              merge="longest" rank="6"/>
822    <metadata name="isbn" merge="unique"/>
823    <metadata name="date" brief="yes" sortkey="numeric"
824              type="year" merge="range" termlist="yes"/>
825    <metadata name="author" brief="yes" termlist="yes"
826              merge="longest" rank="2"/>
827    <metadata name="subject" merge="unique" termlist="yes" rank="3" limitmap="local:"/>
828    <metadata name="url" merge="unique"/>
829    <icu_chain id="relevance" locale="el">
830     <transform rule="[:Control:] Any-Remove"/>
831     <tokenize rule="l"/>
832     <transform rule="[[:WhiteSpace:][:Punctuation:]] Remove"/>
833     <casemap rule="l"/>
834    </icu_chain>
835    <settings src="mysettings"/>
836    <timeout session="60"/>
837   <service>
838  </server>
839 </pazpar2>
840    ]]>
841   </screen>
842  </refsect1>
843
844  <refsect1 id="config-include">
845   <title>INCLUDE FACILITY</title>
846   <para>
847    The XML configuration may be partitioned into multiple files by using
848    the <literal>include</literal> element which takes a single attribute,
849    <literal>src</literal>. The <literal>src</literal> attribute is
850    regular Shell like glob-pattern. For example,
851    <screen><![CDATA[
852    <include src="/etc/pazpar2/conf.d/*.xml"/>
853    ]]></screen>
854   </para>
855   <para>
856    The include facility requires Pazpar2 version 1.2.
857   </para>
858  </refsect1>
859
860  <refsect1 id="target_settings">
861   <title>TARGET SETTINGS</title>
862   <para>
863    Pazpar2 features a cunning scheme by which you can associate various
864    kinds of attributes, or settings with search targets. This can be done
865    through XML files which are read at startup; each file can associate
866    one or more settings with one or more targets. The file format is generic
867    in nature, designed to support a wide range of application requirements.
868    The settings can be purely technical things, like, how to perform a title
869    search against a given target, or it can associate arbitrary name=value
870    pairs with groups of targets -- for instance, if you would like to
871    place all commercial full-text bases in one group for selection
872    purposes, or you would like to control what targets are accessible
873    to users by default. Per-database settings values can even be used
874    to drive sorting, facet/termlist generation, or end-user interface display
875    logic.
876   </para>
877
878   <para>
879    During startup, Pazpar2 will recursively read a specified directory
880    (can be identified in the pazpar2.cfg file or on the command line), and
881    process any settings files found therein.
882   </para>
883
884   <para>
885    Clients of the Pazpar2 webservice interface can selectively override
886    settings for individual targets within the scope of one session. This
887    can be used in conjunction with an external authentication system to
888    determine which resources are to be accessible to which users. Pazpar2
889    itself has no notion of end-users, and so can be used in conjunction
890    with any type of authentication system. Similarly, the authentication
891    tokens submitted to access-controlled search targets can similarly be
892    overridden, to allow use of Pazpar2 in a consortial or multi-library
893    environment, where different end-users may need to be represented to
894    some search targets in different ways. This, again, can be managed
895    using an external database or other lookup mechanism. Setting overrides
896    can be performed either using the
897    <link linkend="command-init">init</link> or the
898    <link linkend="command-settings">settings</link> webservice
899    command.
900   </para>
901
902   <para>
903    In fact, every setting that applies to a database (except pz:id, which
904    can only be used for filtering targets to use for a search) can be overridden
905    on a per-session basis.
906    This allows the client to override specific CCL fields for
907    searching, etc., to meet the needs of a session or user.
908   </para>
909
910   <para>
911    Finally, as an extreme case of this, the webservice client can
912    introduce entirely new targets, on the fly, as part of the
913    <link linkend="command-init">init</link> or
914    <link linkend="command-settings">settings</link> command.
915    This is useful if you desire to manage information
916    about your search targets in a separate application such as a database.
917    You do not need any static settings file whatsoever to run Pazpar2 -- as
918    long as the webservice client is prepared to supply the necessary
919    information at the beginning of every session.
920   </para>
921
922   <note>
923    <para>
924     The following discussion of practical issues related to session
925     and settings management are cast in terms of a user interface based on
926     Ajax/Javascript technology. It would apply equally well to many other
927     kinds of browser-based logic.
928    </para>
929   </note>
930
931   <para>
932    Typically, a Javascript client is not allowed to directly alter the
933    parameters of a session. There are two reasons for this. One has to do
934    with access to information; typically, information about a user will
935    be stored in a system on the server side, or it will be accessible in
936    some way from the server.  However, since the Javascript client cannot
937    be entirely trusted (some hostile agent might in fact 'pretend' to be
938    a regular ws client), it is more robust to control session settings
939    from scripting that you run as part of your webserver. Typically, this
940    can be handled during the session initialization, as follows:
941   </para>
942
943   <para>
944    Step 1: The Javascript client loads, and asks the webserver for a
945    new Pazpar2 session ID. This can be done using a Javascript call, for
946    instance. Note that it is possible to submit Ajax HTTPXmlRequest calls
947    either to Pazpar2 or to the webserver that Pazpar2 is proxying
948    for. See (XXX Insert link to Pazpar2 protocol).
949   </para>
950
951   <para>
952    Step 2: Code on the webserver authenticates the user, by database lookup,
953    LDAP access, NCIP, etc. Determines which resources the user has access to,
954    and any user-specific parameters that are to be applied during this session.
955   </para>
956
957   <para>
958    Step 3: The webserver initializes a new Pazpar2 settings, and sets
959    user-specific parameters as necessary, using the init webservice
960    command. A new session ID is returned.
961   </para>
962
963   <para>
964    Step 4: The webserver returns this session ID to the Javascript
965    client, which then uses the session ID to submit searches, show
966    results, etc.
967   </para>
968
969   <para>
970    Step 5: When the Javascript client ceases to use the session,
971    Pazpar2 destroys any session-specific information.
972   </para>
973
974   <refsect2>
975    <title>SETTINGS FILE FORMAT</title>
976    <para>
977     Each file contains a root element named &lt;settings&gt;. It may
978     contain one or more &lt;set&gt; elements. The settings and set
979     elements may contain the following attributes. Attributes in the set
980     node overrides those in the setting root element. Each set node must
981     specify (directly, or inherited from the parent node) at least a
982     target, name, and value.
983    </para>
984
985    <variablelist>
986     <varlistentry>
987      <term>target</term>
988      <listitem>
989       <para>
990        This specifies the search target to which this setting should be
991        applied. Targets are identified by their Z39.50 URL, generally
992        including the host, port, and database name, (e.g.
993        <literal>bagel.indexdata.com:210/marc</literal>).
994        Two wildcard forms are accepted:
995        * (asterisk) matches all known targets;
996        <literal>bagel.indexdata.com:210/*</literal> matches all
997        known databases on the given host.
998       </para>
999       <para>
1000        A precedence system determines what happens if there are
1001        overlapping values for the same setting name for the same
1002        target. A setting for a specific target name overrides a
1003        setting which specifies target using a wildcard. This makes it
1004        easy to set defaults for all targets, and then override them
1005        for specific targets or hosts. If there are
1006        multiple overlapping settings with the same name and target
1007        value, the 'precedence' attribute determines what happens.
1008       </para>
1009       <para>
1010        For Pazpar2 1.6.4 or later, the target ID may be user-defined, in
1011        which case, the actual host, port, etc is given by setting
1012        <xref linkend="pzurl"/>.
1013       </para>
1014      </listitem>
1015     </varlistentry>
1016     <varlistentry>
1017      <term>name</term>
1018      <listitem>
1019       <para>
1020        The name of the setting. This can be anything you like.
1021        However, Pazpar2 reserves a number of setting names for
1022        specific purposes, all starting with 'pz:', and it is a good
1023        idea to avoid that prefix if you make up your own setting
1024        names. See below for a list of reserved variables.
1025       </para>
1026      </listitem>
1027     </varlistentry>
1028     <varlistentry>
1029      <term>value</term>
1030      <listitem>
1031       <para>
1032        The value of the setting. Generally, this can be anything you
1033        want -- however, some of the reserved settings may expect
1034        specific kinds of values.
1035       </para>
1036      </listitem>
1037     </varlistentry>
1038     <varlistentry>
1039      <term>precedence</term>
1040      <listitem>
1041       <para>
1042        This should be an integer. If not provided, the default value
1043        is 0. If two (or more) settings have the same content for
1044        target and name, the precedence value determines the outcome.
1045        If both settings have the same precedence value, they are both
1046        applied to the target(s). If one has a higher value, then the
1047        value of that setting is applied, and the other one is ignored.
1048       </para>
1049      </listitem>
1050     </varlistentry>
1051    </variablelist>
1052
1053    <para>
1054     By setting defaults for target, name, or value in the root
1055     settings node, you can use the settings files in many different
1056     ways. For instance, you can use a single file to set defaults for
1057     many different settings, like search fields, retrieval syntaxes,
1058     etc. You can have one file per server, which groups settings for
1059     that server or target. You could also have one file which associates
1060     a number of targets with a given setting, for instance, to associate
1061     many databases with a given category or class that makes sense
1062     within your application.
1063    </para>
1064
1065    <para>
1066     The following examples illustrate uses of the settings system to
1067     associate settings with targets to meet different requirements.
1068    </para>
1069
1070    <para>
1071     The example below associates a set of default values that can be
1072     used across many targets. Note the wildcard for targets.
1073     This associates the given settings with all targets for which no
1074     other information is provided.
1075     <screen><![CDATA[
1076     <settings target="*">
1077
1078     <!-- This file introduces default settings for pazpar2 -->
1079
1080     <!-- mapping for unqualified search -->
1081     <set name="pz:cclmap:term" value="u=1016 t=l,r s=al"/>
1082
1083     <!-- field-specific mappings -->
1084     <set name="pz:cclmap:ti" value="u=4 s=al"/>
1085     <set name="pz:cclmap:su" value="u=21 s=al"/>
1086     <set name="pz:cclmap:isbn" value="u=7"/>
1087     <set name="pz:cclmap:issn" value="u=8"/>
1088     <set name="pz:cclmap:date" value="u=30 r=r"/>
1089
1090     <set name="pz:limitmap:title" value="rpn:@attr 1=4 @attr 6=3"/>
1091     <set name="pz:limitmap:date" value="ccl:date"/>
1092
1093     <!-- Retrieval settings -->
1094
1095     <set name="pz:requestsyntax" value="marc21"/>
1096     <set name="pz:elements" value="F"/>
1097
1098     <!-- Query encoding -->
1099     <set name="pz:queryencoding" value="iso-8859-1"/>
1100
1101     <!-- Result normalization settings -->
1102
1103     <set name="pz:nativesyntax" value="iso2709"/>
1104     <set name="pz:xslt" value="../etc/marc21.xsl"/>
1105
1106     </settings>
1107
1108     ]]></screen>
1109    </para>
1110
1111    <para>
1112     The next example shows certain settings overridden for one target,
1113     one which returns XML records containing DublinCore elements, and
1114     which furthermore requires a username/password.
1115     <screen><![CDATA[
1116     <settings target="funkytarget.com:210/db1">
1117     <set name="pz:requestsyntax" value="xml"/>
1118     <set name="pz:nativesyntax" value="xml"/>
1119     <set name="pz:xslt" value="../etc/dublincore.xsl"/>
1120
1121     <set name="pz:authentication" value="myuser/password"/>
1122     </settings>
1123     ]]></screen>
1124    </para>
1125
1126    <para>
1127     The following example associates a specific name/value combination
1128     with a number of targets. The targets below are access-restricted,
1129     and can only be used by users with special credentials.
1130     <screen><![CDATA[
1131     <settings name="pz:allow" value="0">
1132     <set target="funkytarget.com:210/*"/>
1133     <set target="commercial.com:2100/expensiveDb"/>
1134     </settings>
1135     ]]></screen>
1136    </para>
1137
1138   </refsect2>
1139
1140   <refsect2>
1141    <title>RESERVED SETTING NAMES</title>
1142    <para>
1143     The following setting names are reserved by Pazpar2 to control the
1144     behavior of the client function.
1145    </para>
1146
1147    <variablelist>
1148
1149     <varlistentry>
1150      <term>pz:allow</term>
1151      <listitem>
1152       <para>
1153        Allows or denies access to the resources it is applied to. Possible
1154        values are '0' and '1'.
1155        The default is '1' (allow access to this resource).
1156       </para>
1157      </listitem>
1158     </varlistentry>
1159
1160     <varlistentry>
1161      <term>pz:apdulog</term>
1162      <listitem>
1163       <para>
1164        If the 'pz:apdulog' setting is defined and has other value than 0,
1165        then Z39.50 APDUs are written to the log.
1166       </para>
1167      </listitem>
1168     </varlistentry>
1169
1170     <varlistentry>
1171      <term>pz:authentication</term>
1172      <listitem>
1173       <para>
1174        Sets an authentication string for a given database. For Z39.50,
1175        this is carried as part of the Initialize Request. In order to carry
1176        the information in the "open" elements, separate
1177        username and password with a slash (In Z39.50 it is a VisibleString).
1178        In order to carry the information in the idPass  elements, separate
1179        username term, password term and,  optionally, a group term with a
1180        single blank.
1181        If three terms are given, the order is
1182        <emphasis>user, group, password</emphasis>.
1183        If only two terms are given, the order is
1184        <emphasis>user, password</emphasis>.
1185       </para>
1186       <para>
1187        For HTTP based procotols, such as SRU and Apache Solr, the
1188        authentication string includes a username term and, optionally,
1189        a password term.
1190        Each term is separated by a single blank. The
1191        authentication information is passed either by HTTP basic
1192        authentication or via URL parameters. The mode of operation is
1193        determined by <literal>pz:authentication_mode</literal> setting.
1194       </para>
1195      </listitem>
1196     </varlistentry>
1197
1198     <varlistentry>
1199      <term>pz:authentication_mode</term>
1200      <listitem>
1201       <para>
1202        Determines how authentication is carried in HTTP based protocols.
1203        Value may be "<literal>basic</literal>" or "<literal>url</literal>".
1204       </para>
1205      </listitem>
1206     </varlistentry>
1207
1208     <varlistentry>
1209      <term>pz:block_timeout</term>
1210      <listitem>
1211       <para>
1212        (Not yet implemented).
1213        Specifies the time for which a block should be released anyway.
1214       </para>
1215      </listitem>
1216     </varlistentry>
1217
1218     <varlistentry>
1219      <term>pz:cclmap:xxx</term>
1220      <listitem>
1221       <para>
1222        This establishes a CCL field definition or other setting, for
1223        the purpose of mapping end-user queries. XXX is the field or
1224        setting name, and the value of the setting provides parameters
1225        (e.g. parameters to send to the server, etc.). Please consult
1226        the YAZ manual for a full overview of the many capabilities of
1227        the powerful and flexible CCL parser.
1228       </para>
1229       <para>
1230        Note that it is easy to establish a set of default parameters,
1231        and then override them individually for a given target.
1232       </para>
1233      </listitem>
1234     </varlistentry>
1235
1236     <varlistentry>
1237      <term>pz:elements</term>
1238      <listitem>
1239       <para>
1240        The element set name to be used when retrieving records from a
1241        server.
1242       </para>
1243      </listitem>
1244     </varlistentry>
1245
1246     <varlistentry>
1247      <term>pz:extendrecs</term>
1248      <listitem>
1249       <para>
1250        If a show command goes to the boundary of a result set for a
1251        database - depends on sorting - and pz:extendrecs is set to a positive
1252        value. then Pazpar2 wait for show to fetch pz:extendrecs more
1253        records. This setting is best used if a database does native
1254        sorting, because the result set otherwise may be completely
1255        re-sorted during extended fetch.
1256        The default value of pz:extendrecs is 0 (no extended fetch).
1257       </para>
1258       <warning>
1259        <para>
1260         The pz:extendrecs setting appeared in Pazpar2 version 1.6.26.
1261         But the bahavior changed with the release of Pazpar2 1.6.29.
1262        </para>
1263       </warning>
1264      </listitem>
1265     </varlistentry>
1266
1267     <varlistentry>
1268      <term>pz:facetmap:<replaceable>name</replaceable></term>
1269      <listitem>
1270       <para>
1271        Specifies that for field <replaceable>name</replaceable>, the target
1272        supports (native) facets. The value is the name of the
1273        field on the target.
1274       </para>
1275      </listitem>
1276     </varlistentry>
1277
1278     <varlistentry>
1279      <term>pz:facetmap:split:<replaceable>name</replaceable></term>
1280      <listitem>
1281       <para>
1282        Like pz:facetmap, but makes Pazpar2 inspect the term value consisting
1283        of two items separated by colon. First item is the raw ID to be
1284        sent to database if limitmap on the field
1285        <replaceable>name</replaceable> is used. The second item is
1286        the display term.
1287       </para>
1288       <para>
1289        This facility was added in Pazpar2 version 1.11.0.
1290       </para>
1291      </listitem>
1292     </varlistentry>
1293
1294     <varlistentry>
1295      <term>pz:id</term>
1296      <listitem>
1297       <para>
1298        This setting can't be 'set' -- it contains the ID (normally
1299        ZURL) for a given target, and is useful for filtering --
1300        specifically when you want to select one or more specific
1301        targets in the search command.
1302       </para>
1303      </listitem>
1304     </varlistentry>
1305
1306     <varlistentry id="limitmap">
1307      <term>pz:limitmap:<replaceable>name</replaceable></term>
1308      <listitem>
1309       <para>
1310        Specifies attributes for limiting a search to a field - using
1311        the limit parameter for search. It can be used to filter locally
1312        or remotely (search in a target). In some cases the mapping of
1313        a field to a value is identical to an existing cclmap field; in
1314        other cases the field must be specified in a different way - for
1315        example to match a complete field (rather than parts of a subfield).
1316       </para>
1317       <para>
1318        The value of limitmap may have one of three forms: referral to
1319        an existing CCL field, a raw PQF string or a local limit. Leading string
1320        determines type; either <literal>ccl:</literal> for CCL field,
1321        <literal>rpn:</literal> for PQF/RPN, or <literal>local:</literal>
1322        for filtering in Pazpar2. The local filtering may be followed
1323        by a field a metadata field (default is to use the name of the
1324        limitmap itself).
1325       </para>
1326       <para>
1327        For Pazpar2 version 1.6.23 and later the limitmap may include multiple
1328        specifications, separated by <literal>,</literal> (comma).
1329        For example:
1330        <literal>ccl:title,local:ltitle,rpn:@attr 1=4</literal>.
1331       </para>
1332       <note>
1333        <para>
1334         The limitmap facility is supported for Pazpar2 version 1.6.0.
1335         Local filtering is supported in Pazpar2 1.6.6.
1336        </para>
1337       </note>
1338      </listitem>
1339     </varlistentry>
1340
1341     <varlistentry>
1342      <term>pz:maxrecs</term>
1343      <listitem>
1344       <para>
1345        Controls the maximum number of records to be retrieved from a
1346        server. The default is 100.
1347       </para>
1348      </listitem>
1349     </varlistentry>
1350
1351     <varlistentry>
1352      <term>pz:memcached</term>
1353      <listitem>
1354       <para>
1355        If set and non-empty,
1356        <ulink url="&url.libmemcached;">libMemcached</ulink> will
1357        configured and enabled for the target.
1358        The value of this setting is same as the ZOOM option
1359        <literal>memcached</literal>, which  in turn is the configuration
1360        string passed to the <function>memcached</function> function
1361        of <ulink url="&url.libmemcached;">libMemcached</ulink>.
1362       </para>
1363       <para>
1364        This setting is honored in Pazpar2 1.6.39 or later. Pazpar2 must
1365        be using YAZ version 5.0.13 or later.
1366       </para>
1367      </listitem>
1368     </varlistentry>
1369
1370     <varlistentry>
1371      <term>pz:redis</term>
1372      <listitem>
1373       <para>
1374        If set and non-empty,
1375        <ulink url="&url.redis;">redis</ulink> will
1376        configured and enabled for the target.
1377        The value of this setting is exactly as the redis option for
1378        ZOOM C of YAZ.
1379       </para>
1380       <para>
1381        This setting is honored in Pazpar2 1.6.43 or later. Pazpar2 must
1382        be using YAZ version 5.2.0 or later.
1383       </para>
1384      </listitem>
1385     </varlistentry>
1386
1387     <varlistentry>
1388      <term>pz:nativesyntax</term>
1389      <listitem>
1390       <para>
1391        Specifies how Pazpar2 shoule map retrieved records to XML. Currently
1392        supported values are <literal>xml</literal>,
1393        <literal>iso2709</literal> and <literal>txml</literal>.
1394       </para>
1395       <para>
1396        The value <literal>iso2709</literal> makes Pazpar2 convert retrieved
1397        MARC records to MARCXML. In order to convert to XML, the exact
1398        chacater set of the MARC must be known (if not, the resulting
1399        XML is probably not well-formed). The character set may be
1400        specified by adding:
1401        <literal>;</literal><replaceable>charset</replaceable> to
1402        <literal>iso2709</literal>. If omitted, a charset of
1403        MARC-8 is assumed. This is correct for most MARC21/USMARC records.
1404       </para>
1405       <para>
1406        The value <literal>txml</literal> is like <literal>iso2709</literal>
1407        except that records are converted to TurboMARC instead of MARCXML.
1408       </para>
1409       <para>
1410        The value <literal>xml</literal> is used if Pazpar2 retrieves
1411        records that are already XML (no conversion takes place).
1412       </para>
1413      </listitem>
1414     </varlistentry>
1415
1416     <varlistentry>
1417      <term>pz:negotiation_charset</term>
1418      <listitem>
1419       <para>
1420        Sets character set for Z39.50 negotiation. Most targets do not support
1421        this, and some will even close connection if set (crash on server
1422        side or similar). If set, you probably want to set it to
1423        <literal>UTF-8</literal>.
1424       </para>
1425      </listitem>
1426     </varlistentry>
1427
1428     <varlistentry>
1429      <term>pz:piggyback</term>
1430      <listitem>
1431       <para>
1432        Piggybacking enables the server to retrieve records from the
1433        server as part of the search response in Z39.50. Almost all
1434        servers support this (or fail it gracefully), but a few
1435        servers will produce undesirable results.
1436        Set to '1' to enable piggybacking, '0' to disable it. Default
1437        is 1 (piggybacking enabled).
1438       </para>
1439      </listitem>
1440     </varlistentry>
1441     <varlistentry>
1442      <term>pz:pqf_prefix</term>
1443      <listitem>
1444       <para>
1445        Allows you to specify an arbitrary PQF query language substring.
1446        The provided string is prefixed to the user's query after it has been
1447        normalized to PQF internally in pazpar2.
1448        This allows you to attach complex 'filters' to queries for a given
1449        target, sometimes necessary to select sub-catalogs
1450        in union catalog systems, etc.
1451       </para>
1452      </listitem>
1453     </varlistentry>
1454
1455     <varlistentry>
1456      <term>pz:pqf_strftime</term>
1457      <listitem>
1458       <para>
1459        Allows you to extend a query with dates and operators.
1460        The provided string allows certain substitutions and serves as a
1461        format string.
1462        The special two character sequence '%%' gets converted to the
1463        original query. Other characters leading with the percent sign are
1464        conversions supported by strftime.
1465        All other characters are copied verbatim. For example, the string
1466        <literal>@and @attr 1=30 @attr 2=3 %Y %%</literal>
1467        would search for current year combined with the original PQF (%%).
1468       </para>
1469       <para>
1470        This setting can also be used as more general alternative to
1471        pz:pqf_prefix -- a way of embedding the submitted query
1472        anywhere in the string rather than appending it to prefix.  For
1473        example, if it is desired to omit all records satisfying the
1474        query <literal>@attr 1=pica.bib 0007</literal> then this
1475        subquery can be combined with the submitted query as the second
1476        argument of <literal>@andnot</literal> by using the
1477        pz:pqf_strftime value <literal>@not %% @attr 1=pica.bib
1478        0007</literal>.
1479       </para>
1480      </listitem>
1481     </varlistentry>
1482
1483     <varlistentry>
1484      <term>pz:preferred</term>
1485      <listitem>
1486       <para>
1487        Specifies that a target is preferred, e.g. possible local, faster
1488        target. Using block=preferred on <link linkend="command-show">
1489        show command</link> will wait for all these
1490        targets to return records before releasing the block.
1491        If no target is preferred, the block=preferred will identical to
1492        block=1, which release when one target has returned records.
1493       </para>
1494      </listitem>
1495     </varlistentry>
1496
1497     <varlistentry>
1498      <term>pz:present_chunk</term>
1499      <listitem>
1500       <para>
1501        Controls the chunk size in present requests. Pazpar2 will
1502        make (maxrecs / chunk) request(s). The default is 20.
1503       </para>
1504      </listitem>
1505     </varlistentry>
1506
1507     <varlistentry>
1508      <term>pz:queryencoding</term>
1509      <listitem>
1510       <para>
1511        The encoding of the search terms that a target accepts. Most
1512        targets do not honor UTF-8 in which case this needs to be specified.
1513        Each term in a query will be converted if this setting is given.
1514       </para>
1515      </listitem>
1516     </varlistentry>
1517
1518     <varlistentry>
1519      <term>pz:recordfilter</term>
1520      <listitem>
1521       <para>
1522        Specifies a filter which allows Pazpar2 to only include
1523        records that meet a certain criteria in a result.
1524        Unmatched records  will be ignored.
1525        The filter takes the form name, name~value, or name=value, which
1526        will include only records with metadata element (name) that has the
1527        substring (~value) given, or matches exactly (=value).
1528        If value is omitted all records with the named metadata element
1529        present will be included.
1530       </para>
1531      </listitem>
1532     </varlistentry>
1533
1534     <varlistentry id="requestsyntax">
1535      <term>pz:requestsyntax</term>
1536      <listitem>
1537       <para>
1538        This specifies the record syntax to use when requesting
1539        records from a given server. The value can be a symbolic name like
1540        marc21 or xml, or it can be a Z39.50-style dot-separated OID.
1541       </para>
1542      </listitem>
1543     </varlistentry>
1544
1545     <varlistentry>
1546      <term>pz:sort</term>
1547      <listitem>
1548       <para>
1549        Specifies sort criteria to be applied to the result set.
1550        Only works for targets which support the sort service.
1551       </para>
1552      </listitem>
1553     </varlistentry>
1554
1555     <varlistentry id="pzsortmap">
1556      <term>pz:sortmap:<replaceable>field</replaceable></term>
1557      <listitem>
1558       <para>
1559        Specifies native sorting for a target where
1560        <replaceable>field</replaceable> is a sort criterion (see command
1561        show). The value has two components separated by a colon: strategy and
1562        native-field. Strategy is one of <literal>z3950</literal>,
1563        <literal>type7</literal>, <literal>cql</literal>,
1564        <literal>sru11</literal>, or <literal>embed</literal>.
1565        The second component, native-field, is the field that is recognized
1566        by the target.
1567       </para>
1568       <note>
1569        <para>
1570         Only supported for Pazpar2 1.6.4 and later.
1571        </para>
1572       </note>
1573      </listitem>
1574     </varlistentry>
1575
1576     <varlistentry>
1577      <term>pz:sru</term>
1578      <listitem>
1579       <para>
1580        This setting enables
1581        <ulink url="&url.sru;">SRU</ulink>/<ulink url="&url.solr;">Solr</ulink>
1582        support.
1583        It has four possible settings.
1584        'get', enables SRU access through GET requests. 'post' enables SRU/POST
1585        support, less commonly supported, but useful if very large requests are
1586        to be submitted. 'soap' enables the SRW (SRU over SOAP) variation of
1587        the protocol.
1588       </para>
1589       <para>
1590        A value of 'solr' enables Solr client support. This is supported
1591        for Pazpar version 1.5.0 and later.
1592       </para>
1593      </listitem>
1594     </varlistentry>
1595
1596     <varlistentry>
1597      <term>pz:sru_version</term>
1598      <listitem>
1599       <para>
1600        This allows SRU version to be specified. If unset Pazpar2
1601        will the default of YAZ (currently 1.2). Should be set
1602        to 1.1 or 1.2. For Solr, the current supported/tested version
1603        is 1.4 and 3.x.
1604       </para>
1605      </listitem>
1606     </varlistentry>
1607
1608     <varlistentry>
1609      <term>pz:termlist_term_count</term>
1610      <listitem>
1611       <para>
1612        Specifies number of facet terms to be requested from the target.
1613        The default is unspecified e.g. server-decided. Also see pz:facetmap.
1614       </para>
1615      </listitem>
1616     </varlistentry>
1617
1618     <varlistentry>
1619      <term>pz:termlist_term_factor</term>
1620      <listitem>
1621       <para>
1622        Specifies whether to use a factor for pazpar2 generated facets (1)
1623        or not (0).
1624        When mixing locally generated (by the downloaded (pz:maxrecs) samples)
1625        facet with native (target-generated) facets, the later will
1626        dominated the dominate the facet list since they are generated
1627        based on the complete result set.
1628        By scaling up the facet count using the ratio between total hit
1629        count and the sample size,
1630        the total facet count can be approximated and thus better compared
1631        with native facets. This is not enabled by default.
1632       </para>
1633      </listitem>
1634     </varlistentry>
1635
1636
1637     <varlistentry id="pztimeout">
1638      <term>pz:timeout</term>
1639      <listitem>
1640       <para>
1641        Specifies timeout for operation (eg search, and fetch) for
1642        a database. This overrides the z3650_operation timeout
1643        that is given for a service. See <xref linkend="service-timeout"/>.
1644       </para>
1645       <note>
1646        <para>
1647         The timeout facility is supported for Pazpar2 version 1.8.4 and later.
1648        </para>
1649       </note>
1650      </listitem>
1651     </varlistentry>
1652
1653     <varlistentry id="pzurl">
1654      <term>pz:url</term>
1655      <listitem>
1656       <para>
1657        Specifies URL for the target and overrides the target ID.
1658       </para>
1659       <note>
1660        <para>
1661         <literal>pz:url</literal> is only recognized for
1662         Pazpar2 1.6.4 and later.
1663        </para>
1664       </note>
1665      </listitem>
1666     </varlistentry>
1667
1668     <varlistentry>
1669      <term id="pzxslt" xreflabel="pz:xslt">pz:xslt</term>
1670      <listitem>
1671       <para>
1672        Is a comma separated list of of stylesheet names that specifies
1673        how to convert incoming records to the internal representation.
1674       </para>
1675       <para>
1676        For each name, the embedded stylesheets (XSL) that comes with the
1677        service definition are consulted first and takes precedence over
1678        external files; see <xref linkend="servicexslt"/>
1679        of service definition).
1680        If the name does not match an embedded stylesheet it is
1681        considered a filename.
1682       </para>
1683       <para>
1684        The suffix of each file specifies the kind of tranformation.
1685        Suffix "<literal>.xsl</literal>" makes an XSL transform. Suffix
1686        "<literal>.mmap</literal>" will use the MMAP transform (described below).
1687       </para>
1688       <para>
1689        The special value "<literal>auto</literal>" will use a file
1690        which is the <link linkend="requestsyntax">pz:requestsyntax's</link>
1691        value followed by
1692        <literal>'.xsl'</literal>.
1693       </para>
1694       <para>
1695        When mapping MARC records, XSLT can be bypassed for increased
1696        performance with the alternate "MARC map" format.  Provide the
1697        path of a file with extension ".mmap" containing on each line:
1698        <programlisting>
1699        &lt;field&gt; &lt;subfield&gt; &lt;metadata element&gt;</programlisting>
1700        For example:
1701        <programlisting>
1702         245 a title
1703         500 $ description
1704         773 * citation
1705        </programlisting>
1706        To map the field value specify a subfield of '$'.  To store a
1707        concatenation of all subfields, specify a subfield of '*'.
1708       </para>
1709      </listitem>
1710     </varlistentry>
1711
1712     <varlistentry>
1713      <term>pz:zproxy</term>
1714      <listitem>
1715       <para>
1716        The 'pz:zproxy' setting has the value syntax
1717        'host.internet.adress:port', it is used to tunnel Z39.50
1718        requests through the named Z39.50 proxy.
1719       </para>
1720      </listitem>
1721     </varlistentry>
1722
1723    </variablelist>
1724   </refsect2>
1725
1726  </refsect1>
1727  <refsect1>
1728   <title>SEE ALSO</title>
1729   <para>
1730    <citerefentry>
1731     <refentrytitle>pazpar2</refentrytitle>
1732     <manvolnum>8</manvolnum>
1733    </citerefentry>
1734    <citerefentry>
1735     <refentrytitle>yaz-icu</refentrytitle>
1736     <manvolnum>1</manvolnum>
1737    </citerefentry>
1738    <citerefentry>
1739     <refentrytitle>pazpar2_protocol</refentrytitle>
1740     <manvolnum>7</manvolnum>
1741    </citerefentry>
1742   </para>
1743  </refsect1>
1744 </refentry>
1745 <!-- Keep this comment at the end of the file
1746 Local variables:
1747 mode: nxml
1748 nxml-child-indent: 1
1749 End:
1750 -->