From: Mike Taylor Date: Thu, 29 Aug 2002 01:16:12 +0000 (+0000) Subject: New file (nowhere near finished) X-Git-Tag: ZEBRA.1.3.2~42 X-Git-Url: http://git.indexdata.com/?p=idzebra-moved-to-github.git;a=commitdiff_plain;h=8ad5e21914fe3a09f6241a06b25fd7e1bbc1d73e New file (nowhere near finished) --- diff --git a/doc/examples.xml b/doc/examples.xml new file mode 100644 index 0000000..1a08eae --- /dev/null +++ b/doc/examples.xml @@ -0,0 +1,156 @@ + + + Example Configurations + + + Overview + + + zebraidx and zebrasrv are both + driven by a master configuration file, which may refer to other + subsidiary configuration files. By default, they try to use + zebra.cfg in the working directory as the + master file; but this can be changed using the -t + option to specify an alternative master configuration file. + + + The master configuration file tells Zebra: + + + + + Where to find the default indexing rules (### default.idx) + + + + + + ### Something to do with explain.abs?! + + + + + + ### Where to find other configuration files, e.g. searches using + BIB-1 attributes require a bib1.att configuration file (even if + the access point is actually an XPath expression). These are + searched for in the working directory unless otherwise + specified. + + + + + + + + + First Example: Minimal Configuration + + + This example shows how Zebra can be used, with absolutely minimal + configuration, to index a body of XML documents, and search them + using XPath expressions to specify access points. + + + Go to the + zebra/examples/dinosauricon + directory. There you will find three significant files: + + + + + + The records subdirectory, which contains the + raw XML data to be added to the database: in this case, just one + file, genera.xml, which contains information + about all the known dinosaur genera as of October 2000. + + + + + + + The master configuration file, zebra.cfg, + which is as short and simple as it can be: + + + # $Header: /home/cvsroot/idis/doc/examples.xml,v 1.1 2002-08-29 01:16:12 mike Exp $ + # Bare-bones master configuration file for Zebra + attset: bib1.att + + Apart from the comments, which are ignored, all this specifies is + that the server should recognise the attribute set described in + the file called + bib1.att. + + + + + + + The BIB-1 attribute set configuration file, + bib1.att, which is also as short as possible: + + + # $Header: /home/cvsroot/idis/doc/examples.xml,v 1.1 2002-08-29 01:16:12 mike Exp $ + # Bare-bones BIB-1 attribute set file for Zebra + reference Bib-1 + + Apart from the comments, all this specifies is that reference of + the attribute set described by this file is + Bib-1, a name recognised by the system as + referring to a well-known opaque identifier that is transmitted + by clients as part of their searches. + + + + ### Can't we somehow say this trivial thing in the main + configuration file? + + + + + + That's all you need for a minimal Zebra configuration. Now you can + roll the XML records into the database and build the indexes: + + zebraidx -t grs.sgml update records + + + and start the server which, by default listens on port 9999: + + zebrasrv + + + + Now you can use the Z39.50 client program of your choice to execute + XPath-based boolean queries and fetch the XML records that satisfy + them: + + Z> open tcp:@:9999 + Connecting...Ok. + Z> find @attr 1=/GENUS/MEANING @or vertebra jaw + Number of hits: 2 + Z> format xml + Z> show 1 + <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> + + + + + + +