1 <chapter id="examples">
2 <!-- $Id: examples.xml,v 1.2 2002-08-29 16:30:22 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 two 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.2 2002-08-29 16:30:22 mike Exp $
78 # Bare-bones master configuration file for Zebra
79 profilePath: .:../../tab:../../../yaz/tab
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? -->
92 The BIB-1 attribute set configuration file,
93 <literal>bib1.att</literal>, which is also as short as possible:
95 # $Header: /home/cvsroot/idis/doc/examples.xml,v 1.2 2002-08-29 16:30:22 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
115 That's all you need for a minimal Zebra configuration. Now you can
116 roll the XML records into the database and build the indexes:
118 zebraidx -t grs.sgml update records
120 <!-- ### What does "grs.sgml" actually mean? -->
121 and start the server which, by default listens on port 9999:
127 Now you can use the Z39.50 client program of your choice to execute
128 XPath-based boolean queries and fetch the XML records that satisfy
131 Z> open tcp:@:9999
133 Z> find @attr 1=/GENUS/MEANING @or vertebra jaw
138 <GENUS name="Hudiesaurus" type="with" xmlns:idzebra="http://www.indexdata.dk/zebra/">
140 butterfly <LOW>vertebra</LOW> lizard
142 <LENGTH value="30"></LENGTH>
143 <PLACE name="China"></PLACE>
144 <REMAINS content="4 teeth, forelimb, first dorsal vertebra"></REMAINS>
145 <SPECIES name="sinojapanorum" status="nudum">
146 <AUTHOR name="Dong" year="1997"></AUTHOR>
151 <idzebra:size>359</idzebra:size><idzebra:localnumber>447</idzebra:localnumber><idzebra:filename>records/genera.xml</idzebra:filename></GENUS>
158 <!-- Keep this comment at the end of the file
163 sgml-minimize-attributes:nil
164 sgml-always-quote-attributes:t
167 sgml-parent-document: "zebra.xml"
168 sgml-local-catalogs: nil
169 sgml-namecase-general:t