4345774799a9d02a069fa1af76e28502f34f4da7
[metaproxy-moved-to-github.git] / doc / sort.xml
1 <!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook V4.4//EN"
2     "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd" [
3  <!ENTITY copyright SYSTEM "copyright.xml">
4  <!ENTITY % idcommon SYSTEM "common/common.ent">
5      %idcommon;
6 ]>
7 <refentry id="ref-sort">
8  <refentryinfo>
9   <productname>Metaproxy</productname>
10   <info><orgname>Index Data</orgname></info>
11  </refentryinfo>
12
13  <refmeta>
14   <refentrytitle>sort</refentrytitle>
15   <manvolnum>3mp</manvolnum>
16   <refmiscinfo class="manual">Metaproxy Module</refmiscinfo>
17  </refmeta>
18
19  <refnamediv>
20   <refname>sort</refname>
21   <refpurpose>Metaproxy Z39.50 Sort Module</refpurpose>
22  </refnamediv>
23
24  <refsect1><title>DESCRIPTION</title>
25   <para>
26    This filter performs sorting of Z39.50 result sets.
27    The sorting criteria is selected via an X-Path expression. Only
28    XML records are supported. The sorting is done only for the first
29    present request following a search. The number of records to prefetch
30    can is configurable. For example, if a client asks initially for 10
31    records this module may extend that and fetch more records and only
32    return the results in the 10 record window - after sorting.
33   </para>
34   <para>
35    The configuration is given as attribute inside element
36    <literal>sort</literal>. This element must occur exactly once. Future
37    versions of the sort module may include multiple sort elements.
38    The attributes within sort are:
39    <variablelist>
40     <varlistentry><term>xpath</term>
41      <listitem>
42       <para>
43        Specifies the X-Path expression that picks the sorting data from
44        the record.
45       </para>
46      </listitem>
47     </varlistentry>
48     <varlistentry><term>namespaces</term>
49      <listitem>
50       <para>
51        Allows one or more namespaces to be declared with a user-defined
52        prefix. Each prefix may be referred to within the xpath expression.
53       </para>
54      </listitem>
55     </varlistentry>
56     <varlistentry><term>prefetch</term>
57      <listitem>
58       <para>
59        Number of records to prefetch.
60       </para>
61      </listitem>
62     </varlistentry>
63     <varlistentry><term>ascending</term>
64      <listitem>
65       <para>
66        Is a boolean value (false, true). If true, the sort module will
67        sort ascending. If false, the sort module will sort descending.
68        If omitted, the sort order will be ascending.
69       </para>
70      </listitem>
71     </varlistentry>
72    </variablelist>
73   </para>
74  </refsect1>
75
76  <refsect1><title>SCHEMA</title>
77    <literallayout><xi:include
78                      xi:href="../xml/schema/filter_sort.rnc"
79                      xi:parse="text"
80                      xmlns:xi="http://www.w3.org/2001/XInclude" />
81    </literallayout>
82  </refsect1>
83
84  <refsect1><title>EXAMPLES</title>
85   <para>
86    For example, to sort MARCXML records on title, one could use:
87    <screen><![CDATA[
88 <filter type="sort">
89   <sort
90     xpath="/marc:record/marc:datafield[@tag='245']/marc:subfield[@code='a']"
91     namespaces="marc=http://www.loc.gov/MARC21/slim"
92     prefetch="5"
93     ascending="true"
94     debug="true"
95    />
96 </filter>
97 ]]>
98    </screen>
99   </para>
100  </refsect1>
101
102  <refsect1><title>SEE ALSO</title>
103   <para>
104    <citerefentry>
105     <refentrytitle>metaproxy</refentrytitle>
106     <manvolnum>1</manvolnum>
107    </citerefentry>
108   </para>
109   <para>
110    <citerefentry>
111     <refentrytitle>record_transform</refentrytitle>
112     <manvolnum>3mp</manvolnum>
113    </citerefentry>
114   </para>
115  </refsect1>
116
117  &copyright;
118 </refentry>
119
120 <!-- Keep this comment at the end of the file
121 Local variables:
122 mode: nxml
123 nxml-child-indent: 1
124 End:
125 -->