Added description of /proxy/@myurl
[pazpar2-moved-to-github.git] / doc / pazpar2_conf.xml
1 <!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook V4.1//EN"
2  "http://www.oasis-open.org/docbook/xml/4.1/docbookx.dtd"
3 [
4      <!ENTITY % local SYSTEM "local.ent">
5      %local;
6      <!ENTITY % entities SYSTEM "entities.ent">
7      %entities;
8      <!ENTITY % common SYSTEM "common/common.ent">
9      %common;
10 ]>
11 <!-- $Id: pazpar2_conf.xml,v 1.8 2007-02-05 17:16:54 quinn Exp $ -->
12 <refentry id="pazpar2_conf">
13  <refentryinfo>
14   <productname>Pazpar2</productname>
15   <productnumber>&version;</productnumber>
16  </refentryinfo>
17  <refmeta>
18   <refentrytitle>Pazpar2 conf</refentrytitle>
19   <manvolnum>5</manvolnum>
20  </refmeta>
21  
22  <refnamediv>
23   <refname>pazpar2_conf</refname>
24   <refpurpose>Pazpar2 Configuration</refpurpose>
25  </refnamediv>
26  
27  <refsynopsisdiv>
28   <cmdsynopsis>
29    <command>pazpar2.conf</command>
30   </cmdsynopsis>
31  </refsynopsisdiv>
32  
33  <refsect1><title>DESCRIPTION</title>
34    <para>
35      The pazpar2 configuration file, together with any referenced XSLT files,
36      govern pazpar2's behavior as a client, and control the normalization and
37      extraction of data elements from incoming result records, for the
38      purposes of merging, sorting, facet analysis, and display.
39     </para>
40
41     <para>
42       The file is specified using the option -f on the pazpar2 command line.
43       There is not presently a way to reload the configuration file without
44       restarting pazpar2, although this will most likely be added some time
45       in the future.
46     </para>
47  </refsect1>
48
49  <refsect1><title>FORMAT</title>
50    <para>
51      The configuration file is XML-structured. It must be valid XML. All
52      elements specific to pazpar2 should belong to the namespace
53      "http://www.indexdata.com/pazpar2/1.0" (this is assumed in the
54      following examples). The root element is named 'pazpar2'. Under the
55      root element are a number of elements which group categories of
56      information. The categories are described below.
57     </para>
58
59     <refsect2 id="config-server"><title>server</title>
60       <para>
61         This section governs overall behavior of the client. The data
62         elements are described below.
63       </para>
64       <variablelist> <!-- level 1 -->
65         <varlistentry>
66           <term>listen</term>
67           <listitem>
68             <para>
69               Configures the webservice -- this controls how you can connect
70               to pazpar2 from your browser or server-side code. The
71               attributes 'host' and 'port' control the binding of the
72               server. The 'host' attribute can be used to bind the server to
73               a secondary IP address of your system, enabling you to run
74               pazpar2 on port 80 alongside a conventional web server. You
75               can override this setting on the command lineusing the option -h.
76             </para>
77           </listitem>
78         </varlistentry>
79
80         <varlistentry>
81           <term>proxy</term>
82           <listitem>
83             <para>
84               If this item is given, pazpar2 will forward all incoming HTTP
85               requests that do not contain the filename 'search.pz2' to the
86               host and port specified using the 'host' and 'port'
87               attributes. The 'myurl' attribute is required, and should provide
88               the base URL of the server. Generally, the HTTP URL for the host
89               specified in the 'listen' parameter. This functionality is
90               crucial if you wish to use
91               pazpar2 in conjunction with browser-based code (JS, Flash,
92               applets, etc.) which operates in a security sandbox. Such code
93               can only connect to the same server from which the enclosing
94               HTML page originated. Pazpar2s proxy functionality enables you
95               to host all of the main pages (plus images, CSS, etc) of your
96               application on a conventional webserver, while efficiently
97               processing webservice requests for metasearch status, results,
98               etc.
99             </para>
100           </listitem>
101         </varlistentry>
102
103         <varlistentry>
104           <term>service</term>
105           <listitem>
106             <para>
107               This nested element controls the behavior of pazpar2 with
108               respect to your data model. In pazpar2, incoming records are
109               normalized, using XSLT, into an internal representation (see
110               the <link
111               linkend="config-retrievalprofile">retrievalprofile</link> secion.
112               The 'service' section controls the further processing and
113               extraction of data from the internal representation, primarily
114               through the 'metdata' sub-element.
115             </para>
116
117             <variablelist> <!-- Level 2 -->
118               <varlistentry><term>metadata</term>
119                 <listitem>
120                   <para>
121                     One of these elements is required for every data element in
122                     the internal representation of the record (see
123                     <xref linkend="data_model"/>. It governs
124                     subsequent processing as pertains to sorting, relevance
125                     ranking, merging, and display of data elements. It supports
126                     the following attributes:
127                   </para>
128
129                   <variablelist> <!-- level 3 -->
130                     <varlistentry><term>name</term>
131                       <listitem>
132                         <para>
133                           This is the name of the data element. It is matched
134                           against the 'type' attribute of the 'metadata' element
135                           in the normalized record. A warning is produced if
136                           metdata elements with an unknown name are found in the
137                           normalized record. This name is also used to represent
138                           data elements in the records returned by the
139                           webservice API, and to name sort lists and browse
140                           facets.
141                         </para>
142                       </listitem>
143                     </varlistentry>
144
145                     <varlistentry><term>type</term>
146                      <listitem>
147                         <para>
148                           The type of data element. This value governs any
149                           normalization or special processing that might take
150                           place on an element. Possible values are 'generic'
151                           (basic string), 'year' (a range is computed if
152                           multiple years are found in the record). Note: This
153                           list is likely to increase in the future.
154                         </para>
155                       </listitem>
156                     </varlistentry>
157
158                     <varlistentry><term>brief</term>
159                       <listitem>
160                         <para>
161                           If this is set to 'yes', then the data element is
162                           includes in brief records in the webservice API. Note
163                           that this only makes sense for metadata elements that
164                           are merged (see below). The default value is 'no'.
165                         </para>
166                       </listitem>
167                     </varlistentry>
168
169                     <varlistentry><term>sortkey</term>
170                       <listitem>
171                         <para>
172                           Specifies that this data element is to be used for
173                           sorting. The possible values are 'numeric' (numeric
174                           value), 'skiparticle' (string; skip common, leading
175                           articles), and 'no' (no sorting). The default value is
176                           'no'.
177                         </para>
178                       </listitem>
179                     </varlistentry>
180
181                     <varlistentry><term>rank</term>
182                       <listitem>
183                         <para>
184                           Specifies that this element is to be used to help rank
185                           records against the user's query (when ranking is
186                           requested). The value is an integer, used as a
187                           multiplier against the basic TF*IDF score. A value of
188                           1 is the base, higher values give additional weight to
189                           elements of this type. The default is '0', which
190                           excludes this element from the rank calculation.
191                         </para>
192                       </listitem>
193                     </varlistentry>
194
195                     <varlistentry><term>termlist</term>
196                       <listitem>
197                         <para>
198                           Specifies that this element is to be used as a
199                           termlist, or browse facet. Values are tabulated from
200                           incoming records, and a highscore of values (with
201                           their associated frequency) is made available to the
202                           client through the webservice API. The possible values
203                           are 'yes' and 'no' (default).
204                         </para>
205                       </listitem>
206                     </varlistentry>
207
208                     <varlistentry><term>merge</term>
209                       <listitem>
210                         <para>
211                           This governs whether, and how elements are extracted
212                           from individual records and merged into cluster
213                           records. The possible values are: 'unique' (include
214                           all unique elements), 'longest' (include only the
215                           longest element (strlen), 'range' (calculate a range
216                           of values across al matching records), 'all' (include
217                           all elements), or 'no' (don't merge; this is the
218                           default);
219                         </para>
220                       </listitem>
221                     </varlistentry>
222                   </variablelist> <!-- attributes to metadata -->
223
224                 </listitem>
225               </varlistentry>
226             </variablelist>     <!-- Data elements in service directive -->
227           </listitem>
228         </varlistentry>
229       </variablelist>           <!-- Data elements in server directive -->
230     </refsect2>
231
232     <refsect2 id="config-queryprofile"><title>queryprofile</title>
233       <para>
234         At the moment, this directive is ignored; there is one global
235         CCL-mapping file which governs the mapping of queries to Z39.50
236         type-1. This file is located in etc/default.bib. This will change
237         shortly.
238       </para>
239     </refsect2>
240
241     <refsect2 id="config_retrievalprofile"><title>retrievalprofile</title>
242       <para>
243         Note: In the present version, there is a single retrieval
244         profile. However, in a future release, it will be possible to
245         associate unique retrieval profiles with different targets, or to
246         generate retrieval profiles using XSLT from the ZeeRex description of
247         a target.
248       </para>
249       
250       <para>
251         The following data elements are recognized for the retrievalprofile
252         directive:
253       </para>
254       
255       <variablelist>
256         <varlistentry><term>requestsyntax</term>
257           <listitem>
258             <para>
259               This element specifies the request syntax to be used in queries. It only
260               makes sense for Z39.50-type targets.
261             </para>
262           </listitem>
263         </varlistentry>
264
265         <varlistentry><term>nativesyntax</term>
266           <listitem>
267             <para>
268               This element specifies the native syntax and encoding of the
269               result records. The default is XML. The following attributes
270               are defined:
271             </para>
272             <variablelist>
273               <varlistentry><term>name</term>
274                 <listitem>
275                   <para>
276                     The name of the syntax. Currently recognized values are
277                     'iso2709' (MARC), and 'xml'.
278                   </para>
279                 </listitem>
280               </varlistentry>
281
282               <varlistentry><term>format</term>
283                 <listitem>
284                   <para>
285                     The format, or schema, to be expected. Default is
286                     'marc21'.
287                   </para>
288                 </listitem>
289               </varlistentry>
290
291               <varlistentry><term>encoding</term>
292                 <listitem>
293                   <para>
294                     The encoding of the response record. Typical values for
295                     MARC records are 'marc8' (general MARC-8), 'marc8s'
296                     (MARC-8, but maps to precomposed UTF-8 characters, more
297                     suitable for use in web browsers), 'latin1'.
298                   </para>
299                 </listitem>
300               </varlistentry>
301
302               <varlistentry><term>mapto</term>
303                 <listitem>
304                   <para>
305                     Specifies the flavor of MARCXML to map results to.
306                     Default is 'marcxml'. 'marcxchange' is also possible, and
307                     useful for Danish DANMARC records.
308                   </para>
309                 </listitem>
310               </varlistentry>
311             </variablelist> <!-- parameters to nativesyntax directive -->
312           </listitem>
313         </varlistentry>
314       </variablelist> <!-- sub-elements in retrievalprofile -->
315     </refsect2>
316
317   </refsect1>
318  
319  <refsect1><title>EXAMPLE</title>
320   <para>Below is a working example configuration:
321   <screen><![CDATA[
322 <?xml version="1.0" encoding="UTF-8"?>
323 <pazpar2 xmlns="http://www.indexdata.com/pazpar2/1.0">
324
325 <server>
326   <listen port="9004"/>
327   <proxy host="us1.indexdata.com"/>
328
329   <service>
330     <metadata name="title" brief="yes" sortkey="skiparticle" merge="longest" rank="6"/>
331     <metadata name="isbn" merge="unique"/>
332     <metadata name="date" brief="yes" sortkey="numeric" type="year" merge="range"
333             termlist="yes"/>
334     <metadata name="author" brief="yes" termlist="yes" merge="longest" rank="2"/>
335     <metadata name="subject" merge="unique" termlist="yes" rank="3"/>
336     <metadata name="url" merge="unique"/>
337   </service>
338 </server>
339
340 <queryprofile/>  <!-- Like a CCL profile++ . Can optionally refer to XSLT to 
341        convert ZeeRex into queryprofile. Multiple profiles can exist.  -->
342
343 <retrievalprofile>
344   <requestsyntax>marc21</requestsyntax>
345   <nativesyntax name="iso2709" format="marc21" encoding="marc8s" mapto="marcxml"/>
346   <map type="xslt" stylesheet="marc21.xsl"/>
347 </retrievalprofile>
348
349 </pazpar2>
350 ]]></screen>
351    </para>
352  </refsect1> 
353 </refentry>
354 <!-- Keep this comment at the end of the file
355 Local variables:
356 mode: sgml
357 sgml-omittag:t
358 sgml-shorttag:t
359 sgml-minimize-attributes:nil
360 sgml-always-quote-attributes:t
361 sgml-indent-step:1
362 sgml-indent-data:t
363 sgml-parent-document:nil
364 sgml-local-catalogs: nil
365 sgml-namecase-general:t
366 End:
367 -->