1 <chapter id="examples">
2 <!-- $Id: examples.xml,v 1.1 2002-08-29 01:16:12 mike Exp $ -->
3 <title>Example Configurations</title>
6 <title>Overview</title>
9 <literal>zebraidx</literal> and <literal>zebrasrv</literal> are both
10 driven by a master configuration file, which may refer to other
11 subsidiary configuration files. By default, they try to use
12 <filename>zebra.cfg</filename> in the working directory as the
13 master file; but this can be changed using the <literal>-t</literal>
14 option to specify an alternative master configuration file.
17 The master configuration file tells Zebra:
22 Where to find the default indexing rules (### default.idx)
28 ### Something to do with explain.abs?!
34 ### Where to find other configuration files, e.g. searches using
35 BIB-1 attributes require a bib1.att configuration file (even if
36 the access point is actually an XPath expression). These are
37 searched for in the working directory unless otherwise
47 <title>First Example: Minimal Configuration</title>
50 This example shows how Zebra can be used, with absolutely minimal
51 configuration, to index a body of XML documents, and search them
52 using XPath expressions to specify access points.
56 <literal>zebra/examples/dinosauricon</literal>
57 directory. There you will find three significant files:
63 The <literal>records</literal> subdirectory, which contains the
64 raw XML data to be added to the database: in this case, just one
65 file, <literal>genera.xml</literal>, which contains information
66 about all the known dinosaur genera as of October 2000.
67 <!-- ### Get more recent data -->
73 The master configuration file, <literal>zebra.cfg</literal>,
74 which is as short and simple as it can be:
75 <!-- ### Keep this up to date -->
77 # $Header: /home/cvsroot/idis/doc/examples.xml,v 1.1 2002-08-29 01:16:12 mike Exp $
78 # Bare-bones master configuration file for Zebra
81 Apart from the comments, which are ignored, all this specifies is
82 that the server should recognise the attribute set described in
84 <literal>bib1.att</literal>.
86 <!-- ### What is an attribute set? -->
91 The BIB-1 attribute set configuration file,
92 <literal>bib1.att</literal>, which is also as short as possible:
93 <!-- ### Keep this up to date -->
95 # $Header: /home/cvsroot/idis/doc/examples.xml,v 1.1 2002-08-29 01:16:12 mike Exp $
96 # Bare-bones BIB-1 attribute set file for Zebra
99 Apart from the comments, all this specifies is that reference of
100 the attribute set described by this file is
101 <literal>Bib-1</literal>, a name recognised by the system as
102 referring to a well-known opaque identifier that is transmitted
103 by clients as part of their searches.
104 <!-- ### Yeuch! Surely we can say that better! -->
107 ### Can't we somehow say this trivial thing in the main
114 That's all you need for a minimal Zebra configuration. Now you can
115 roll the XML records into the database and build the indexes:
117 zebraidx -t grs.sgml update records
119 <!-- ### What does "grs.sgml" actually mean? -->
120 and start the server which, by default listens on port 9999:
126 Now you can use the Z39.50 client program of your choice to execute
127 XPath-based boolean queries and fetch the XML records that satisfy
130 Z> open tcp:@:9999
132 Z> find @attr 1=/GENUS/MEANING @or vertebra jaw
136 <GENUS name="Anurognathus" type="with" xmlns:idzebra="http://www.indexdata.dk/zebra/"><SPECIES name="ammoni"><AUTHOR name="Doederline" year="1923"></AUTHOR></SPECIES><MEANING>tailless<I>or</I>anuran<LOW>(frog)</LOW>jaw</MEANING><TIME value="Tithonian" section="late"></TIME><PLACE name="Germany"></PLACE><LENGTH wingspan="1" value=".5"></LENGTH><idzebra:size>304</idzebra:size><idzebra:localnumber>70</idzebra:localnumber><idzebra:filename>records/genera.xml</idzebra:filename></GENUS>
143 <!-- Keep this comment at the end of the file
148 sgml-minimize-attributes:nil
149 sgml-always-quote-attributes:t
152 sgml-parent-document: "zebra.xml"
153 sgml-local-catalogs: nil
154 sgml-namecase-general:t