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