1 <chapter id="administration">
2 <title>Administrating &zebra;</title>
3 <!-- ### It's a bit daft that this chapter (which describes half of
4 the configuration-file formats) is separated from
5 "recordmodel-grs.xml" (which describes the other half) by the
6 instructions on running zebraidx and zebrasrv. Some careful
7 re-ordering is required here.
11 Unlike many simpler retrieval systems, &zebra; supports safe, incremental
12 updates to an existing index.
16 Normally, when &zebra; modifies the index it reads a number of records
18 Depending on your specifications and on the contents of each record
19 one the following events take place for each record:
26 The record is indexed as if it never occurred before.
27 Either the &zebra; system doesn't know how to identify the record or
28 &zebra; can identify the record but didn't find it to be already indexed.
36 The record has already been indexed.
37 In this case either the contents of the record or the location
38 (file) of the record indicates that it has been indexed before.
46 The record is deleted from the index. As in the
47 update-case it must be able to identify the record.
55 Please note that in both the modify- and delete- case the &zebra;
56 indexer must be able to generate a unique key that identifies the record
57 in question (more on this below).
61 To administrate the &zebra; retrieval system, you run the
62 <literal>zebraidx</literal> program.
63 This program supports a number of options which are preceded by a dash,
64 and a few commands (not preceded by dash).
68 Both the &zebra; administrative tool and the &acro.z3950; server share a
69 set of index files and a global configuration file.
70 The name of the configuration file defaults to
71 <literal>zebra.cfg</literal>.
72 The configuration file includes specifications on how to index
73 various kinds of records and where the other configuration files
74 are located. <literal>zebrasrv</literal> and <literal>zebraidx</literal>
75 <emphasis>must</emphasis> be run in the directory where the
76 configuration file lives unless you indicate the location of the
77 configuration file by option <literal>-c</literal>.
80 <sect1 id="record-types">
81 <title>Record Types</title>
84 Indexing is a per-record process, in which either insert/modify/delete
85 will occur. Before a record is indexed search keys are extracted from
86 whatever might be the layout the original record (sgml,html,text, etc..).
87 The &zebra; system currently supports two fundamental types of records:
88 structured and simple text.
89 To specify a particular extraction process, use either the
90 command line option <literal>-t</literal> or specify a
91 <literal>recordType</literal> setting in the configuration file.
96 <sect1 id="zebra-cfg">
97 <title>The &zebra; Configuration File</title>
100 The &zebra; configuration file, read by <literal>zebraidx</literal> and
101 <literal>zebrasrv</literal> defaults to <literal>zebra.cfg</literal>
102 unless specified by <literal>-c</literal> option.
106 You can edit the configuration file with a normal text editor.
107 parameter names and values are separated by colons in the file. Lines
108 starting with a hash sign (<literal>#</literal>) are
113 If you manage different sets of records that share common
114 characteristics, you can organize the configuration settings for each
116 When <literal>zebraidx</literal> is run and you wish to address a
117 given group you specify the group name with the <literal>-g</literal>
119 In this case settings that have the group name as their prefix
120 will be used by <literal>zebraidx</literal>.
121 If no <literal>-g</literal> option is specified, the settings
122 without prefix are used.
126 In the configuration file, the group name is placed before the option
127 name itself, separated by a dot (.). For instance, to set the record type
128 for group <literal>public</literal> to <literal>grs.sgml</literal>
129 (the &acro.sgml;-like format for structured records) you would write:
134 public.recordType: grs.sgml
139 To set the default value of the record type to <literal>text</literal>
150 The available configuration settings are summarized below. They will be
151 explained further in the following sections.
155 FIXME - Didn't Adam make something to have multiple databases in multiple dirs...
163 <emphasis>group</emphasis>
164 .recordType[<emphasis>.name</emphasis>]:
165 <replaceable>type</replaceable>
169 Specifies how records with the file extension
170 <emphasis>name</emphasis> should be handled by the indexer.
171 This option may also be specified as a command line option
172 (<literal>-t</literal>). Note that if you do not specify a
173 <emphasis>name</emphasis>, the setting applies to all files.
174 In general, the record type specifier consists of the elements (each
175 element separated by dot), <emphasis>fundamental-type</emphasis>,
176 <emphasis>file-read-type</emphasis> and arguments. Currently, two
177 fundamental types exist, <literal>text</literal> and
178 <literal>grs</literal>.
183 <term><emphasis>group</emphasis>.recordId:
184 <replaceable>record-id-spec</replaceable></term>
187 Specifies how the records are to be identified when updated. See
188 <xref linkend="locating-records"/>.
193 <term><emphasis>group</emphasis>.database:
194 <replaceable>database</replaceable></term>
197 Specifies the &acro.z3950; database name.
198 <!-- FIXME - now we can have multiple databases in one server. -H -->
203 <term><emphasis>group</emphasis>.storeKeys:
204 <replaceable>boolean</replaceable></term>
207 Specifies whether key information should be saved for a given
208 group of records. If you plan to update/delete this type of
209 records later this should be specified as 1; otherwise it
210 should be 0 (default), to save register space.
211 <!-- ### this is the first mention of "register" -->
212 See <xref linkend="file-ids"/>.
217 <term><emphasis>group</emphasis>.storeData:
218 <replaceable>boolean</replaceable></term>
221 Specifies whether the records should be stored internally
222 in the &zebra; system files.
223 If you want to maintain the raw records yourself,
224 this option should be false (0).
225 If you want &zebra; to take care of the records for you, it
231 <!-- ### probably a better place to define "register" -->
232 <term>register: <replaceable>register-location</replaceable></term>
235 Specifies the location of the various register files that &zebra; uses
236 to represent your databases.
237 See <xref linkend="register-location"/>.
242 <term>shadow: <replaceable>register-location</replaceable></term>
245 Enables the <emphasis>safe update</emphasis> facility of &zebra;, and
246 tells the system where to place the required, temporary files.
247 See <xref linkend="shadow-registers"/>.
252 <term>lockDir: <replaceable>directory</replaceable></term>
255 Directory in which various lock files are stored.
260 <term>keyTmpDir: <replaceable>directory</replaceable></term>
263 Directory in which temporary files used during zebraidx's update
269 <term>setTmpDir: <replaceable>directory</replaceable></term>
272 Specifies the directory that the server uses for temporary result sets.
273 If not specified <literal>/tmp</literal> will be used.
278 <term>profilePath: <replaceable>path</replaceable></term>
281 Specifies a path of profile specification files.
282 The path is composed of one or more directories separated by
283 colon. Similar to <literal>PATH</literal> for UNIX systems.
289 <term>modulePath: <replaceable>path</replaceable></term>
292 Specifies a path of record filter modules.
293 The path is composed of one or more directories separated by
294 colon. Similar to <literal>PATH</literal> for UNIX systems.
295 The 'make install' procedure typically puts modules in
296 <filename>/usr/local/lib/idzebra-2.0/modules</filename>.
302 <term>index: <replaceable>filename</replaceable></term>
305 Defines the filename which holds fields structure
306 definitions. If omitted, the file <filename>default.idx</filename>
308 Refer to <xref linkend="default-idx-file"/> for
315 <term>sortmax: <replaceable>integer</replaceable></term>
318 Specifies the maximum number of records that will be sorted
319 in a result set. If the result set contains more than
320 <replaceable>integer</replaceable> records, records after the
321 limit will not be sorted. If omitted, the default value is
328 <term>staticrank: <replaceable>integer</replaceable></term>
331 Enables whether static ranking is to be enabled (1) or
332 disabled (0). If omitted, it is disabled - corresponding
334 Refer to <xref linkend="administration-ranking-static"/> .
341 <term>estimatehits:: <replaceable>integer</replaceable></term>
344 Controls whether &zebra; should calculate approximate hit counts and
345 at which hit count it is to be enabled.
346 A value of 0 disables approximate hit counts.
347 For a positive value approximate hit count is enabled
348 if it is known to be larger than <replaceable>integer</replaceable>.
351 Approximate hit counts can also be triggered by a particular
352 attribute in a query.
353 Refer to <xref linkend="querymodel-zebra-global-attr-limit"/>.
359 <term>attset: <replaceable>filename</replaceable></term>
362 Specifies the filename(s) of attribute set files for use in
363 searching. In many configurations <filename>bib1.att</filename>
364 is used, but that is not required. If Classic Explain
365 attributes is to be used for searching,
366 <filename>explain.att</filename> must be given.
367 The path to att-files in general can be given using
368 <literal>profilePath</literal> setting.
369 See also <xref linkend="attset-files"/>.
374 <term>memMax: <replaceable>size</replaceable></term>
377 Specifies <replaceable>size</replaceable> of internal memory
378 to use for the zebraidx program.
379 The amount is given in megabytes - default is 4 (4 MB).
380 The more memory, the faster large updates happen, up to about
381 half the free memory available on the computer.
386 <term>tempfiles: <replaceable>Yes/Auto/No</replaceable></term>
389 Tells zebra if it should use temporary files when indexing. The
390 default is Auto, in which case zebra uses temporary files only
391 if it would need more that <replaceable>memMax</replaceable>
392 megabytes of memory. This should be good for most uses.
398 <term>root: <replaceable>dir</replaceable></term>
401 Specifies a directory base for &zebra;. All relative paths
402 given (in profilePath, register, shadow) are based on this
403 directory. This setting is useful if your &zebra; server
404 is running in a different directory from where
405 <literal>zebra.cfg</literal> is located.
411 <term>passwd: <replaceable>file</replaceable></term>
414 Specifies a file with description of user accounts for &zebra;.
415 The format is similar to that known to Apache's htpasswd files
416 and UNIX' passwd files. Non-empty lines not beginning with
417 # are considered account lines. There is one account per-line.
418 A line consists of fields separate by a single colon character.
419 First field is username, second is password.
425 <term>passwd.c: <replaceable>file</replaceable></term>
428 Specifies a file with description of user accounts for &zebra;.
429 File format is similar to that used by the passwd directive except
430 that the password are encrypted. Use Apache's htpasswd or similar
437 <term>perm.<replaceable>user</replaceable>:
438 <replaceable>permstring</replaceable></term>
441 Specifies permissions (privilege) for a user that are allowed
442 to access &zebra; via the passwd system. There are two kinds
443 of permissions currently: read (r) and write(w). By default
444 users not listed in a permission directive are given the read
445 privilege. To specify permissions for a user with no
446 username, or &acro.z3950; anonymous style use
447 <literal>anonymous</literal>. The permstring consists of
448 a sequence of characters. Include character <literal>w</literal>
449 for write/update access, <literal>r</literal> for read access and
450 <literal>a</literal> to allow anonymous access through this account.
456 <term>dbaccess <replaceable>accessfile</replaceable></term>
459 Names a file which lists database subscriptions for individual users.
460 The access file should consists of lines of the form <literal>username:
461 dbnames</literal>, where dbnames is a list of database names, separated by
462 '+'. No whitespace is allowed in the database list.
468 <term>encoding <replaceable>charsetname</replaceable></term>
471 Tells Zebra to interpret the terms in Z39.50 queries as
472 having been encoded using the specified character
473 encoding. The default is <literal>ISO-8859-1</literal>; one
474 useful alternative is <literal>UTF-8</literal>.
483 <sect1 id="locating-records">
484 <title>Locating Records</title>
487 The default behavior of the &zebra; system is to reference the
488 records from their original location, i.e. where they were found when you
489 run <literal>zebraidx</literal>.
490 That is, when a client wishes to retrieve a record
491 following a search operation, the files are accessed from the place
492 where you originally put them - if you remove the files (without
493 running <literal>zebraidx</literal> again, the server will return
494 diagnostic number 14 (``System error in presenting records'') to
499 If your input files are not permanent - for example if you retrieve
500 your records from an outside source, or if they were temporarily
501 mounted on a CD-ROM drive,
502 you may want &zebra; to make an internal copy of them. To do this,
503 you specify 1 (true) in the <literal>storeData</literal> setting. When
504 the &acro.z3950; server retrieves the records they will be read from the
505 internal file structures of the system.
510 <sect1 id="simple-indexing">
511 <title>Indexing with no Record IDs (Simple Indexing)</title>
514 If you have a set of records that are not expected to change over time
515 you may can build your database without record IDs.
516 This indexing method uses less space than the other methods and
521 To use this method, you simply omit the <literal>recordId</literal> entry
522 for the group of files that you index. To add a set of records you use
523 <literal>zebraidx</literal> with the <literal>update</literal> command. The
524 <literal>update</literal> command will always add all of the records that it
525 encounters to the index - whether they have already been indexed or
526 not. If the set of indexed files change, you should delete all of the
527 index files, and build a new index from scratch.
531 Consider a system in which you have a group of text files called
532 <literal>simple</literal>.
533 That group of records should belong to a &acro.z3950; database called
534 <literal>textbase</literal>.
535 The following <literal>zebra.cfg</literal> file will suffice:
540 profilePath: /usr/local/idzebra/tab
542 simple.recordType: text
543 simple.database: textbase
549 Since the existing records in an index can not be addressed by their
550 IDs, it is impossible to delete or modify records when using this method.
555 <sect1 id="file-ids">
556 <title>Indexing with File Record IDs</title>
559 If you have a set of files that regularly change over time: Old files
560 are deleted, new ones are added, or existing files are modified, you
561 can benefit from using the <emphasis>file ID</emphasis>
562 indexing methodology.
563 Examples of this type of database might include an index of WWW
564 resources, or a USENET news spool area.
565 Briefly speaking, the file key methodology uses the directory paths
566 of the individual records as a unique identifier for each record.
567 To perform indexing of a directory with file keys, again, you specify
568 the top-level directory after the <literal>update</literal> command.
569 The command will recursively traverse the directories and compare
570 each one with whatever have been indexed before in that same directory.
571 If a file is new (not in the previous version of the directory) it
572 is inserted into the registers; if a file was already indexed and
573 it has been modified since the last update, the index is also
574 modified; if a file has been removed since the last
575 visit, it is deleted from the index.
579 The resulting system is easy to administrate. To delete a record you
580 simply have to delete the corresponding file (say, with the
581 <literal>rm</literal> command). And to add records you create new
582 files (or directories with files). For your changes to take effect
583 in the register you must run <literal>zebraidx update</literal> with
584 the same directory root again. This mode of operation requires more
585 disk space than simpler indexing methods, but it makes it easier for
586 you to keep the index in sync with a frequently changing set of data.
587 If you combine this system with the <emphasis>safe update</emphasis>
588 facility (see below), you never have to take your server off-line for
589 maintenance or register updating purposes.
593 To enable indexing with pathname IDs, you must specify
594 <literal>file</literal> as the value of <literal>recordId</literal>
595 in the configuration file. In addition, you should set
596 <literal>storeKeys</literal> to <literal>1</literal>, since the &zebra;
597 indexer must save additional information about the contents of each record
598 in order to modify the indexes correctly at a later time.
602 FIXME - There must be a simpler way to do this with Adams string tags -H
606 For example, to update records of group <literal>esdd</literal>
608 <literal>/data1/records/</literal> you should type:
610 $ zebraidx -g esdd update /data1/records
615 The corresponding configuration file includes:
618 esdd.recordType: grs.sgml
624 <para>You cannot start out with a group of records with simple
625 indexing (no record IDs as in the previous section) and then later
626 enable file record Ids. &zebra; must know from the first time that you
628 the files should be indexed with file record IDs.
633 You cannot explicitly delete records when using this method (using the
634 <literal>delete</literal> command to <literal>zebraidx</literal>. Instead
635 you have to delete the files from the file system (or move them to a
637 and then run <literal>zebraidx</literal> with the
638 <literal>update</literal> command.
640 <!-- ### what happens if a file contains multiple records? -->
643 <sect1 id="generic-ids">
644 <title>Indexing with General Record IDs</title>
647 When using this method you construct an (almost) arbitrary, internal
648 record key based on the contents of the record itself and other system
649 information. If you have a group of records that explicitly associates
650 an ID with each record, this method is convenient. For example, the
651 record format may contain a title or a ID-number - unique within the group.
652 In either case you specify the &acro.z3950; attribute set and use-attribute
653 location in which this information is stored, and the system looks at
654 that field to determine the identity of the record.
658 As before, the record ID is defined by the <literal>recordId</literal>
659 setting in the configuration file. The value of the record ID specification
660 consists of one or more tokens separated by whitespace. The resulting
661 ID is represented in the index by concatenating the tokens and
662 separating them by ASCII value (1).
666 There are three kinds of tokens:
670 <term>Internal record info</term>
673 The token refers to a key that is
674 extracted from the record. The syntax of this token is
675 <literal>(</literal> <emphasis>set</emphasis> <literal>,</literal>
676 <emphasis>use</emphasis> <literal>)</literal>,
677 where <emphasis>set</emphasis> is the
678 attribute set name <emphasis>use</emphasis> is the
679 name or value of the attribute.
684 <term>System variable</term>
687 The system variables are preceded by
692 and immediately followed by the system variable name, which
705 <term>database</term>
708 Current database specified.
725 <term>Constant string</term>
728 A string used as part of the ID — surrounded
729 by single- or double quotes.
737 For instance, the sample GILS records that come with the &zebra;
738 distribution contain a unique ID in the data tagged Control-Identifier.
739 The data is mapped to the &acro.bib1; use attribute Identifier-standard
740 (code 1007). To use this field as a record id, specify
741 <literal>(bib1,Identifier-standard)</literal> as the value of the
742 <literal>recordId</literal> in the configuration file.
743 If you have other record types that uses the same field for a
744 different purpose, you might add the record type
745 (or group or database name) to the record id of the gils
746 records as well, to prevent matches with other types of records.
747 In this case the recordId might be set like this:
750 gils.recordId: $type (bib1,Identifier-standard)
756 (see <xref linkend="grs"/>
757 for details of how the mapping between elements of your records and
758 searchable attributes is established).
762 As for the file record ID case described in the previous section,
763 updating your system is simply a matter of running
764 <literal>zebraidx</literal>
765 with the <literal>update</literal> command. However, the update with general
766 keys is considerably slower than with file record IDs, since all files
767 visited must be (re)read to discover their IDs.
771 As you might expect, when using the general record IDs
772 method, you can only add or modify existing records with the
773 <literal>update</literal> command.
774 If you wish to delete records, you must use the,
775 <literal>delete</literal> command, with a directory as a parameter.
776 This will remove all records that match the files below that root
782 <sect1 id="register-location">
783 <title>Register Location</title>
786 Normally, the index files that form dictionaries, inverted
787 files, record info, etc., are stored in the directory where you run
788 <literal>zebraidx</literal>. If you wish to store these, possibly large,
789 files somewhere else, you must add the <literal>register</literal>
790 entry to the <literal>zebra.cfg</literal> file.
791 Furthermore, the &zebra; system allows its file
792 structures to span multiple file systems, which is useful for
793 managing very large databases.
797 The value of the <literal>register</literal> setting is a sequence
798 of tokens. Each token takes the form:
801 <emphasis>dir</emphasis><literal>:</literal><emphasis>size</emphasis>
804 The <emphasis>dir</emphasis> specifies a directory in which index files
805 will be stored and the <emphasis>size</emphasis> specifies the maximum
806 size of all files in that directory. The &zebra; indexer system fills
807 each directory in the order specified and use the next specified
808 directories as needed.
809 The <emphasis>size</emphasis> is an integer followed by a qualifier
811 <literal>b</literal> for bytes,
812 <literal>k</literal> for kilobytes.
813 <literal>M</literal> for megabytes,
814 <literal>G</literal> for gigabytes.
815 Specifying a negative value disables the checking (it still needs the unit,
816 use <literal>-1b</literal>).
820 For instance, if you have allocated three disks for your register, and
821 the first disk is mounted
822 on <literal>/d1</literal> and has 2GB of free space, the
823 second, mounted on <literal>/d2</literal> has 3.6 GB, and the third,
824 on which you have more space than you bother to worry about, mounted on
825 <literal>/d3</literal> you could put this entry in your configuration file:
828 register: /d1:2G /d2:3600M /d3:-1b
833 Note that &zebra; does not verify that the amount of space specified is
834 actually available on the directory (file system) specified - it is
835 your responsibility to ensure that enough space is available, and that
836 other applications do not attempt to use the free space. In a large
837 production system, it is recommended that you allocate one or more
838 file system exclusively to the &zebra; register files.
843 <sect1 id="shadow-registers">
844 <title>Safe Updating - Using Shadow Registers</title>
846 <sect2 id="shadow-registers-description">
847 <title>Description</title>
850 The &zebra; server supports <emphasis>updating</emphasis> of the index
851 structures. That is, you can add, modify, or remove records from
852 databases managed by &zebra; without rebuilding the entire index.
853 Since this process involves modifying structured files with various
854 references between blocks of data in the files, the update process
855 is inherently sensitive to system crashes, or to process interruptions:
856 Anything but a successfully completed update process will leave the
857 register files in an unknown state, and you will essentially have no
858 recourse but to re-index everything, or to restore the register files
859 from a backup medium.
860 Further, while the update process is active, users cannot be
861 allowed to access the system, as the contents of the register files
862 may change unpredictably.
866 You can solve these problems by enabling the shadow register system in
868 During the updating procedure, <literal>zebraidx</literal> will temporarily
869 write changes to the involved files in a set of "shadow
870 files", without modifying the files that are accessed by the
871 active server processes. If the update procedure is interrupted by a
872 system crash or a signal, you simply repeat the procedure - the
873 register files have not been changed or damaged, and the partially
874 written shadow files are automatically deleted before the new updating
879 At the end of the updating procedure (or in a separate operation, if
880 you so desire), the system enters a "commit mode". First,
881 any active server processes are forced to access those blocks that
882 have been changed from the shadow files rather than from the main
883 register files; the unmodified blocks are still accessed at their
884 normal location (the shadow files are not a complete copy of the
885 register files - they only contain those parts that have actually been
886 modified). If the commit process is interrupted at any point during the
887 commit process, the server processes will continue to access the
888 shadow files until you can repeat the commit procedure and complete
889 the writing of data to the main register files. You can perform
890 multiple update operations to the registers before you commit the
891 changes to the system files, or you can execute the commit operation
892 at the end of each update operation. When the commit phase has
893 completed successfully, any running server processes are instructed to
894 switch their operations to the new, operational register, and the
895 temporary shadow files are deleted.
900 <sect2 id="shadow-registers-how-to-use">
901 <title>How to Use Shadow Register Files</title>
904 The first step is to allocate space on your system for the shadow
906 You do this by adding a <literal>shadow</literal> entry to the
907 <literal>zebra.cfg</literal> file.
908 The syntax of the <literal>shadow</literal> entry is exactly the
909 same as for the <literal>register</literal> entry
910 (see <xref linkend="register-location"/>).
911 The location of the shadow area should be
912 <emphasis>different</emphasis> from the location of the main register
913 area (if you have specified one - remember that if you provide no
914 <literal>register</literal> setting, the default register area is the
915 working directory of the server and indexing processes).
919 The following excerpt from a <literal>zebra.cfg</literal> file shows
920 one example of a setup that configures both the main register
921 location and the shadow file area.
922 Note that two directories or partitions have been set aside
923 for the shadow file area. You can specify any number of directories
924 for each of the file areas, but remember that there should be no
925 overlaps between the directories used for the main registers and the
926 shadow files, respectively.
932 shadow: /scratch1:100M /scratch2:200M
938 When shadow files are enabled, an extra command is available at the
939 <literal>zebraidx</literal> command line.
940 In order to make changes to the system take effect for the
941 users, you'll have to submit a "commit" command after a
942 (sequence of) update operation(s).
948 $ zebraidx update /d1/records
955 Or you can execute multiple updates before committing the changes:
961 $ zebraidx -g books update /d1/records /d2/more-records
962 $ zebraidx -g fun update /d3/fun-records
969 If one of the update operations above had been interrupted, the commit
970 operation on the last line would fail: <literal>zebraidx</literal>
971 will not let you commit changes that would destroy the running register.
972 You'll have to rerun all of the update operations since your last
973 commit operation, before you can commit the new changes.
977 Similarly, if the commit operation fails, <literal>zebraidx</literal>
978 will not let you start a new update operation before you have
979 successfully repeated the commit operation.
980 The server processes will keep accessing the shadow files rather
981 than the (possibly damaged) blocks of the main register files
982 until the commit operation has successfully completed.
986 You should be aware that update operations may take slightly longer
987 when the shadow register system is enabled, since more file access
988 operations are involved. Further, while the disk space required for
989 the shadow register data is modest for a small update operation, you
990 may prefer to disable the system if you are adding a very large number
991 of records to an already very large database (we use the terms
992 <emphasis>large</emphasis> and <emphasis>modest</emphasis>
993 very loosely here, since every application will have a
994 different perception of size).
995 To update the system without the use of the the shadow files,
996 simply run <literal>zebraidx</literal> with the <literal>-n</literal>
997 option (note that you do not have to execute the
998 <emphasis>commit</emphasis> command of <literal>zebraidx</literal>
999 when you temporarily disable the use of the shadow registers in
1001 Note also that, just as when the shadow registers are not enabled,
1002 server processes will be barred from accessing the main register
1003 while the update procedure takes place.
1011 <sect1 id="administration-ranking">
1012 <title>Relevance Ranking and Sorting of Result Sets</title>
1014 <sect2 id="administration-overview">
1015 <title>Overview</title>
1017 The default ordering of a result set is left up to the server,
1018 which inside &zebra; means sorting in ascending document ID order.
1019 This is not always the order humans want to browse the sometimes
1020 quite large hit sets. Ranking and sorting comes to the rescue.
1024 In cases where a good presentation ordering can be computed at
1025 indexing time, we can use a fixed <literal>static ranking</literal>
1026 scheme, which is provided for the <literal>alvis</literal>
1027 indexing filter. This defines a fixed ordering of hit lists,
1028 independently of the query issued.
1032 There are cases, however, where relevance of hit set documents is
1033 highly dependent on the query processed.
1034 Simply put, <literal>dynamic relevance ranking</literal>
1035 sorts a set of retrieved records such that those most likely to be
1036 relevant to your request are retrieved first.
1037 Internally, &zebra; retrieves all documents that satisfy your
1038 query, and re-orders the hit list to arrange them based on
1039 a measurement of similarity between your query and the content of
1044 Finally, there are situations where hit sets of documents should be
1045 <literal>sorted</literal> during query time according to the
1046 lexicographical ordering of certain sort indexes created at
1052 <sect2 id="administration-ranking-static">
1053 <title>Static Ranking</title>
1056 &zebra; uses internally inverted indexes to look up term frequencies
1057 in documents. Multiple queries from different indexes can be
1058 combined by the binary boolean operations <literal>AND</literal>,
1059 <literal>OR</literal> and/or <literal>NOT</literal> (which
1060 is in fact a binary <literal>AND NOT</literal> operation).
1061 To ensure fast query execution
1062 speed, all indexes have to be sorted in the same order.
1065 The indexes are normally sorted according to document
1066 <literal>ID</literal> in
1067 ascending order, and any query which does not invoke a special
1068 re-ranking function will therefore retrieve the result set in
1070 <literal>ID</literal>
1078 directive in the main core &zebra; configuration file, the internal document
1079 keys used for ordering are augmented by a preceding integer, which
1080 contains the static rank of a given document, and the index lists
1082 first by ascending static rank,
1083 then by ascending document <literal>ID</literal>.
1085 is the ``best'' rank, as it occurs at the
1086 beginning of the list; higher numbers represent worse scores.
1089 The experimental <literal>alvis</literal> filter provides a
1090 directive to fetch static rank information out of the indexed &acro.xml;
1091 records, thus making <emphasis>all</emphasis> hit sets ordered
1092 after <emphasis>ascending</emphasis> static
1093 rank, and for those doc's which have the same static rank, ordered
1094 after <emphasis>ascending</emphasis> doc <literal>ID</literal>.
1095 See <xref linkend="record-model-alvisxslt"/> for the gory details.
1100 <sect2 id="administration-ranking-dynamic">
1101 <title>Dynamic Ranking</title>
1103 In order to fiddle with the static rank order, it is necessary to
1104 invoke additional re-ranking/re-ordering using dynamic
1105 ranking or score functions. These functions return positive
1106 integer scores, where <emphasis>highest</emphasis> score is
1108 hit sets are sorted according to <emphasis>descending</emphasis>
1110 to the index lists which are sorted according to
1111 ascending rank number and document ID).
1114 Dynamic ranking is enabled by a directive like one of the
1115 following in the zebra configuration file (use only one of these a time!):
1117 rank: rank-1 # default TDF-IDF like
1118 rank: rank-static # dummy do-nothing
1123 Dynamic ranking is done at query time rather than
1124 indexing time (this is why we
1125 call it ``dynamic ranking'' in the first place ...)
1126 It is invoked by adding
1127 the &acro.bib1; relation attribute with
1128 value ``relevance'' to the &acro.pqf; query (that is,
1129 <literal>@attr 2=102</literal>, see also
1130 <ulink url="&url.z39.50;bib1.html">
1131 The &acro.bib1; Attribute Set Semantics</ulink>, also in
1132 <ulink url="&url.z39.50.attset.bib1;">HTML</ulink>).
1133 To find all articles with the word <literal>Eoraptor</literal> in
1134 the title, and present them relevance ranked, issue the &acro.pqf; query:
1136 @attr 2=102 @attr 1=4 Eoraptor
1140 <sect3 id="administration-ranking-dynamic-rank1">
1141 <title>Dynamically ranking using &acro.pqf; queries with the 'rank-1'
1145 The default <literal>rank-1</literal> ranking module implements a
1146 TF/IDF (Term Frequecy over Inverse Document Frequency) like
1147 algorithm. In contrast to the usual definition of TF/IDF
1148 algorithms, which only considers searching in one full-text
1149 index, this one works on multiple indexes at the same time.
1151 &zebra; does boolean queries and searches in specific addressed
1152 indexes (there are inverted indexes pointing from terms in the
1153 dictionary to documents and term positions inside documents).
1157 <term>Query Components</term>
1160 First, the boolean query is dismantled into its principal components,
1161 i.e. atomic queries where one term is looked up in one index.
1162 For example, the query
1164 @attr 2=102 @and @attr 1=1010 Utah @attr 1=1018 Springer
1166 is a boolean AND between the atomic parts
1168 @attr 2=102 @attr 1=1010 Utah
1172 @attr 2=102 @attr 1=1018 Springer
1174 which gets processed each for itself.
1180 <term>Atomic hit lists</term>
1183 Second, for each atomic query, the hit list of documents is
1187 In this example, two hit lists for each index
1188 <literal>@attr 1=1010</literal> and
1189 <literal>@attr 1=1018</literal> are computed.
1195 <term>Atomic scores</term>
1198 Third, each document in the hit list is assigned a score (_if_ ranking
1199 is enabled and requested in the query) using a TF/IDF scheme.
1202 In this example, both atomic parts of the query assign the magic
1203 <literal>@attr 2=102</literal> relevance attribute, and are
1204 to be used in the relevance ranking functions.
1207 It is possible to apply dynamic ranking on only parts of the
1210 @and @attr 2=102 @attr 1=1010 Utah @attr 1=1018 Springer
1212 searches for all documents which have the term 'Utah' on the
1213 body of text, and which have the term 'Springer' in the publisher
1214 field, and sort them in the order of the relevance ranking made on
1215 the body-of-text index only.
1221 <term>Hit list merging</term>
1224 Fourth, the atomic hit lists are merged according to the boolean
1225 conditions to a final hit list of documents to be returned.
1228 This step is always performed, independently of the fact that
1229 dynamic ranking is enabled or not.
1235 <term>Document score computation</term>
1238 Fifth, the total score of a document is computed as a linear
1239 combination of the atomic scores of the atomic hit lists
1242 Ranking weights may be used to pass a value to a ranking
1243 algorithm, using the non-standard &acro.bib1; attribute type 9.
1244 This allows one branch of a query to use one value while
1245 another branch uses a different one. For example, we can search
1246 for <literal>utah</literal> in the
1247 <literal>@attr 1=4</literal> index with weight 30, as
1248 well as in the <literal>@attr 1=1010</literal> index with weight 20:
1250 @attr 2=102 @or @attr 9=30 @attr 1=4 utah @attr 9=20 @attr 1=1010 city
1254 The default weight is
1255 sqrt(1000) ~ 34 , as the &acro.z3950; standard prescribes that the top score
1256 is 1000 and the bottom score is 0, encoded in integers.
1260 The ranking-weight feature is experimental. It may change in future
1268 <term>Re-sorting of hit list</term>
1271 Finally, the final hit list is re-ordered according to scores.
1279 Still need to describe the exact TF/IDF formula. Here's the info, need -->
1280 <!--to extract it in human readable form .. MC
1282 static int calc (void *set_handle, zint sysno, zint staticrank,
1285 int i, lo, divisor, score = 0;
1286 struct rank_set_info *si = (struct rank_set_info *) set_handle;
1288 if (!si->no_rank_entries)
1289 return -1; /* ranking not enabled for any terms */
1291 for (i = 0; i < si->no_entries; i++)
1293 yaz_log(log_level, "calc: i=%d rank_flag=%d lo=%d",
1294 i, si->entries[i].rank_flag, si->entries[i].local_occur);
1295 if (si->entries[i].rank_flag && (lo = si->entries[i].local_occur))
1296 score += (8+log2_int (lo)) * si->entries[i].global_inv *
1297 si->entries[i].rank_weight;
1299 divisor = si->no_rank_entries * (8+log2_int (si->last_pos/si->no_entries));
1300 score = score / divisor;
1301 yaz_log(log_level, "calc sysno=" ZINT_FORMAT " score=%d", sysno, score);
1304 /* reset the counts for the next term */
1305 for (i = 0; i < si->no_entries; i++)
1306 si->entries[i].local_occur = 0;
1311 where lo = si->entries[i].local_occur is the local documents term-within-index frequency, si->entries[i].global_inv represents the IDF part (computed in static void *begin()), and
1312 si->entries[i].rank_weight is the weight assigner per index (default 34, or set in the @attr 9=xyz magic)
1314 Finally, the IDF part is computed as:
1316 static void *begin (struct zebra_register *reg,
1317 void *class_handle, RSET rset, NMEM nmem,
1318 TERMID *terms, int numterms)
1320 struct rank_set_info *si =
1321 (struct rank_set_info *) nmem_malloc (nmem,sizeof(*si));
1324 yaz_log(log_level, "rank-1 begin");
1325 si->no_entries = numterms;
1326 si->no_rank_entries = 0;
1328 si->entries = (struct rank_term_info *)
1329 nmem_malloc (si->nmem, sizeof(*si->entries)*numterms);
1330 for (i = 0; i < numterms; i++)
1332 zint g = rset_count(terms[i]->rset);
1333 yaz_log(log_level, "i=%d flags=%s '%s'", i,
1334 terms[i]->flags, terms[i]->name );
1335 if (!strncmp (terms[i]->flags, "rank,", 5))
1337 const char *cp = strstr(terms[i]->flags+4, ",w=");
1338 si->entries[i].rank_flag = 1;
1340 si->entries[i].rank_weight = atoi (cp+3);
1342 si->entries[i].rank_weight = 34; /* sqrroot of 1000 */
1343 yaz_log(log_level, " i=%d weight=%d g="ZINT_FORMAT, i,
1344 si->entries[i].rank_weight, g);
1345 (si->no_rank_entries)++;
1348 si->entries[i].rank_flag = 0;
1349 si->entries[i].local_occur = 0; /* FIXME */
1350 si->entries[i].global_occur = g;
1351 si->entries[i].global_inv = 32 - log2_int (g);
1352 yaz_log(log_level, " global_inv = %d g = " ZINT_FORMAT,
1353 (int) (32-log2_int (g)), g);
1354 si->entries[i].term = terms[i];
1355 si->entries[i].term_index=i;
1356 terms[i]->rankpriv = &(si->entries[i]);
1362 where g = rset_count(terms[i]->rset) is the count of all documents in this specific index hit list, and the IDF part then is
1364 si->entries[i].global_inv = 32 - log2_int (g);
1371 The <literal>rank-1</literal> algorithm
1372 does not use the static rank
1373 information in the list keys, and will produce the same ordering
1374 with or without static ranking enabled.
1379 <sect3 id="administration-ranking-dynamic-rank1">
1380 <title>Dynamically ranking &acro.pqf; queries with the 'rank-static'
1383 The dummy <literal>rank-static</literal> reranking/scoring
1384 function returns just
1385 <literal>score = max int - staticrank</literal>
1386 in order to preserve the static ordering of hit sets that would
1387 have been produced had it not been invoked.
1388 Obviously, to combine static and dynamic ranking usefully,
1390 to make a new ranking
1391 function; this is left
1392 as an exercise for the reader.
1399 <literal>Dynamic ranking</literal> is not compatible
1400 with <literal>estimated hit sizes</literal>, as all documents in
1401 a hit set must be accessed to compute the correct placing in a
1402 ranking sorted list. Therefore the use attribute setting
1403 <literal>@attr 2=102</literal> clashes with
1404 <literal>@attr 9=integer</literal>.
1409 we might want to add ranking like this:
1411 Simple BM25 Extension to Multiple Weighted Fields
1412 Stephen Robertson, Hugo Zaragoza and Michael Taylor
1416 mitaylor2microsoft.com
1421 <sect3 id="administration-ranking-dynamic-cql">
1422 <title>Dynamically ranking &acro.cql; queries</title>
1424 Dynamic ranking can be enabled during sever side &acro.cql;
1425 query expansion by adding <literal>@attr 2=102</literal>
1426 chunks to the &acro.cql; config file. For example
1428 relationModifier.relevant = 2=102
1430 invokes dynamic ranking each time a &acro.cql; query of the form
1433 Z> f alvis.text =/relevant house
1435 is issued. Dynamic ranking can also be automatically used on
1436 specific &acro.cql; indexes by (for example) setting
1438 index.alvis.text = 1=text 2=102
1440 which then invokes dynamic ranking each time a &acro.cql; query of the form
1443 Z> f alvis.text = house
1453 <sect2 id="administration-ranking-sorting">
1454 <title>Sorting</title>
1456 &zebra; sorts efficiently using special sorting indexes
1457 (type=<literal>s</literal>; so each sortable index must be known
1458 at indexing time, specified in the configuration of record
1459 indexing. For example, to enable sorting according to the &acro.bib1;
1460 <literal>Date/time-added-to-db</literal> field, one could add the line
1462 xelm /*/@created Date/time-added-to-db:s
1464 to any <literal>.abs</literal> record-indexing configuration file.
1465 Similarly, one could add an indexing element of the form
1467 <z:index name="date-modified" type="s">
1468 <xsl:value-of select="some/xpath"/>
1471 to any <literal>alvis</literal>-filter indexing stylesheet.
1474 Indexing can be specified at searching time using a query term
1475 carrying the non-standard
1476 &acro.bib1; attribute-type <literal>7</literal>. This removes the
1477 need to send a &acro.z3950; <literal>Sort Request</literal>
1478 separately, and can dramatically improve latency when the client
1479 and server are on separate networks.
1480 The sorting part of the query is separate from the rest of the
1481 query - the actual search specification - and must be combined
1485 A sorting subquery needs two attributes: an index (such as a
1486 &acro.bib1; type-1 attribute) specifying which index to sort on, and a
1487 type-7 attribute whose value is be <literal>1</literal> for
1488 ascending sorting, or <literal>2</literal> for descending. The
1489 term associated with the sorting attribute is the priority of
1490 the sort key, where <literal>0</literal> specifies the primary
1491 sort key, <literal>1</literal> the secondary sort key, and so
1494 <para>For example, a search for water, sort by title (ascending),
1495 is expressed by the &acro.pqf; query
1497 @or @attr 1=1016 water @attr 7=1 @attr 1=4 0
1499 whereas a search for water, sort by title ascending,
1500 then date descending would be
1502 @or @or @attr 1=1016 water @attr 7=1 @attr 1=4 0 @attr 7=2 @attr 1=30 1
1506 Notice the fundamental differences between <literal>dynamic
1507 ranking</literal> and <literal>sorting</literal>: there can be
1508 only one ranking function defined and configured; but multiple
1509 sorting indexes can be specified dynamically at search
1510 time. Ranking does not need to use specific indexes, so
1511 dynamic ranking can be enabled and disabled without
1512 re-indexing; whereas, sorting indexes need to be
1513 defined before indexing.
1521 <sect1 id="administration-extended-services">
1522 <title>Extended Services: Remote Insert, Update and Delete</title>
1526 Extended services are only supported when accessing the &zebra;
1527 server using the <ulink url="&url.z39.50;">&acro.z3950;</ulink>
1528 protocol. The <ulink url="&url.sru;">&acro.sru;</ulink> protocol does
1529 not support extended services.
1534 The extended services are not enabled by default in zebra - due to the
1535 fact that they modify the system. &zebra; can be configured
1537 search, and to allow only updates for a particular admin user
1538 in the main zebra configuration file <filename>zebra.cfg</filename>.
1539 For user <literal>admin</literal>, you could use:
1543 passwd: passwordfile
1545 And in the password file
1546 <filename>passwordfile</filename>, you have to specify users and
1547 encrypted passwords as colon separated strings.
1548 Use a tool like <filename>htpasswd</filename>
1549 to maintain the encrypted passwords.
1553 It is essential to configure &zebra; to store records internally,
1555 modifications and deletion of records:
1560 The general record type should be set to any record filter which
1561 is able to parse &acro.xml; records, you may use any of the two
1562 declarations (but not both simultaneously!)
1564 recordType: dom.filter_dom_conf.xml
1565 # recordType: grs.xml
1567 Notice the difference to the specific instructions
1569 recordType.xml: dom.filter_dom_conf.xml
1570 # recordType.xml: grs.xml
1572 which only work when indexing XML files from the filesystem using
1573 the <literal>*.xml</literal> naming convention.
1576 To enable transaction safe shadow indexing,
1577 which is extra important for this kind of operation, set
1579 shadow: directoryname: size (e.g. 1000M)
1581 See <xref linkend="zebra-cfg"/> for additional information on
1582 these configuration options.
1586 It is not possible to carry information about record types or
1587 similar to &zebra; when using extended services, due to
1588 limitations of the <ulink url="&url.z39.50;">&acro.z3950;</ulink>
1589 protocol. Therefore, indexing filters can not be chosen on a
1590 per-record basis. One and only one general &acro.xml; indexing filter
1592 <!-- but because it is represented as an OID, we would need some
1593 form of proprietary mapping scheme between record type strings and
1596 However, as a minimum, it would be extremely useful to enable
1597 people to use &acro.marc21;, assuming grs.marcxml.marc21 as a record
1604 <sect2 id="administration-extended-services-z3950">
1605 <title>Extended services in the &acro.z3950; protocol</title>
1608 The <ulink url="&url.z39.50;">&acro.z3950;</ulink> standard allows
1609 servers to accept special binary <emphasis>extended services</emphasis>
1610 protocol packages, which may be used to insert, update and delete
1611 records into servers. These carry control and update
1612 information to the servers, which are encoded in seven package fields:
1615 <table id="administration-extended-services-z3950-table" frame="top">
1616 <title>Extended services &acro.z3950; Package Fields</title>
1620 <entry>Parameter</entry>
1621 <entry>Value</entry>
1622 <entry>Notes</entry>
1627 <entry><literal>type</literal></entry>
1628 <entry><literal>'update'</literal></entry>
1629 <entry>Must be set to trigger extended services</entry>
1632 <entry><literal>action</literal></entry>
1633 <entry><literal>string</literal></entry>
1635 Extended service action type with
1636 one of four possible values: <literal>recordInsert</literal>,
1637 <literal>recordReplace</literal>,
1638 <literal>recordDelete</literal>,
1639 and <literal>specialUpdate</literal>
1643 <entry><literal>record</literal></entry>
1644 <entry><literal>&acro.xml; string</literal></entry>
1645 <entry>An &acro.xml; formatted string containing the record</entry>
1648 <entry><literal>syntax</literal></entry>
1649 <entry><literal>'xml'</literal></entry>
1650 <entry>XML/SUTRS/MARC. GRS-1 not supported.
1651 The default filter (record type) as given by recordType in
1652 zebra.cfg is used to parse the record.</entry>
1655 <entry><literal>recordIdOpaque</literal></entry>
1656 <entry><literal>string</literal></entry>
1658 Optional client-supplied, opaque record
1659 identifier used under insert operations.
1663 <entry><literal>recordIdNumber </literal></entry>
1664 <entry><literal>positive number</literal></entry>
1665 <entry>&zebra;'s internal system number,
1666 not allowed for <literal>recordInsert</literal> or
1667 <literal>specialUpdate</literal> actions which result in fresh
1672 <entry><literal>databaseName</literal></entry>
1673 <entry><literal>database identifier</literal></entry>
1675 The name of the database to which the extended services should be
1685 The <literal>action</literal> parameter can be any of
1686 <literal>recordInsert</literal> (will fail if the record already exists),
1687 <literal>recordReplace</literal> (will fail if the record does not exist),
1688 <literal>recordDelete</literal> (will fail if the record does not
1690 <literal>specialUpdate</literal> (will insert or update the record
1691 as needed, record deletion is not possible).
1695 During all actions, the
1696 usual rules for internal record ID generation apply, unless an
1697 optional <literal>recordIdNumber</literal> &zebra; internal ID or a
1698 <literal>recordIdOpaque</literal> string identifier is assigned.
1699 The default ID generation is
1700 configured using the <literal>recordId:</literal> from
1701 <filename>zebra.cfg</filename>.
1702 See <xref linkend="zebra-cfg"/>.
1706 Setting of the <literal>recordIdNumber</literal> parameter,
1707 which must be an existing &zebra; internal system ID number, is not
1708 allowed during any <literal>recordInsert</literal> or
1709 <literal>specialUpdate</literal> action resulting in fresh record
1714 When retrieving existing
1715 records indexed with &acro.grs1; indexing filters, the &zebra; internal
1716 ID number is returned in the field
1717 <literal>/*/id:idzebra/localnumber</literal> in the namespace
1718 <literal>xmlns:id="http://www.indexdata.dk/zebra/"</literal>,
1719 where it can be picked up for later record updates or deletes.
1723 A new element set for retrieval of internal record
1724 data has been added, which can be used to access minimal records
1725 containing only the <literal>recordIdNumber</literal> &zebra;
1726 internal ID, or the <literal>recordIdOpaque</literal> string
1727 identifier. This works for any indexing filter used.
1728 See <xref linkend="special-retrieval"/>.
1732 The <literal>recordIdOpaque</literal> string parameter
1733 is an client-supplied, opaque record
1734 identifier, which may be used under
1735 insert, update and delete operations. The
1736 client software is responsible for assigning these to
1737 records. This identifier will
1738 replace zebra's own automagic identifier generation with a unique
1739 mapping from <literal>recordIdOpaque</literal> to the
1740 &zebra; internal <literal>recordIdNumber</literal>.
1741 <emphasis>The opaque <literal>recordIdOpaque</literal> string
1743 are not visible in retrieval records, nor are
1744 searchable, so the value of this parameter is
1745 questionable. It serves mostly as a convenient mapping from
1746 application domain string identifiers to &zebra; internal ID's.
1752 <sect2 id="administration-extended-services-yaz-client">
1753 <title>Extended services from yaz-client</title>
1756 We can now start a yaz-client admin session and create a database:
1759 $ yaz-client localhost:9999 -u admin/secret
1763 Now the <literal>Default</literal> database was created,
1764 we can insert an &acro.xml; file (esdd0006.grs
1765 from example/gils/records) and index it:
1768 Z> update insert id1234 esdd0006.grs
1771 The 3rd parameter - <literal>id1234</literal> here -
1772 is the <literal>recordIdOpaque</literal> package field.
1775 Actually, we should have a way to specify "no opaque record id" for
1776 yaz-client's update command.. We'll fix that.
1779 The newly inserted record can be searched as usual:
1784 Received SearchResponse.
1785 Search was a success.
1786 Number of hits: 1, setno 1
1787 SearchResult-1: term=utah cnt=1
1794 Let's delete the beast, using the same
1795 <literal>recordIdOpaque</literal> string parameter:
1798 Z> update delete id1234
1799 No last record (update ignored)
1800 Z> update delete 1 esdd0006.grs
1801 Got extended services response
1806 Received SearchResponse.
1807 Search was a success.
1808 Number of hits: 0, setno 2
1809 SearchResult-1: term=utah cnt=0
1816 If shadow register is enabled in your
1817 <filename>zebra.cfg</filename>,
1818 you must run the adm-commit command
1824 after each update session in order write your changes from the
1825 shadow to the life register space.
1830 <sect2 id="administration-extended-services-yaz-php">
1831 <title>Extended services from yaz-php</title>
1834 Extended services are also available from the &yaz; &acro.php; client layer. An
1835 example of an &yaz;-&acro.php; extended service transaction is given here:
1838 $record = '<record><title>A fine specimen of a record</title></record>';
1840 $options = array('action' => 'recordInsert',
1842 'record' => $record,
1843 'databaseName' => 'mydatabase'
1846 yaz_es($yaz, 'update', $options);
1847 yaz_es($yaz, 'commit', array());
1850 if ($error = yaz_error($yaz))
1857 <sect2 id="administration-extended-services-debugging">
1858 <title>Extended services debugging guide</title>
1860 When debugging ES over PHP we recommend the following order of tests:
1866 Make sure you have a nice record on your filesystem, which you can
1867 index from the filesystem by use of the zebraidx command.
1868 Do it exactly as you planned, using one of the GRS-1 filters,
1869 or the DOMXML filter.
1870 When this works, proceed.
1875 Check that your server setup is OK before you even coded one single
1877 Take the same record form the file system, and send as ES via
1878 <literal>yaz-client</literal> like described in
1879 <xref linkend="administration-extended-services-yaz-client"/>,
1881 remember the <literal>-a</literal> option which tells you what
1882 goes over the wire! Notice also the section on permissions:
1887 in <literal>zebra.cfg</literal> to make sure you do not run into
1888 permission problems (but never expose such an insecure setup on the
1889 internet!!!). Then, make sure to set the general
1890 <literal>recordType</literal> instruction, pointing correctly
1891 to the GRS-1 filters,
1892 or the DOMXML filters.
1897 If you insist on using the <literal>sysno</literal> in the
1898 <literal>recordIdNumber</literal> setting,
1899 please make sure you do only updates and deletes. Zebra's internal
1900 system number is not allowed for
1901 <literal>recordInsert</literal> or
1902 <literal>specialUpdate</literal> actions
1903 which result in fresh record inserts.
1908 If <literal>shadow register</literal> is enabled in your
1909 <literal>zebra.cfg</literal>, you must remember running the
1918 If this works, then proceed to do the same thing in your PHP script.
1930 <!-- Keep this comment at the end of the file
1935 sgml-minimize-attributes:nil
1936 sgml-always-quote-attributes:t
1939 sgml-parent-document: "zebra.xml"
1940 sgml-local-catalogs: nil
1941 sgml-namecase-general:t