1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114
|
<html><head><meta charset="ISO-8859-1"><title>4.Retrieval of Zebra internal record data</title><meta name="generator" content="DocBook XSL Stylesheets Vsnapshot"><link rel="home" href="index.html" title="Zebra - User's Guide and Reference"><link rel="up" href="architecture.html" title="Chapter4.Overview of Zebra Architecture"><link rel="prev" href="architecture-workflow.html" title="3.Indexing and Retrieval Workflow"><link rel="next" href="querymodel.html" title="Chapter5.Query Model"></head><body><link rel="stylesheet" type="text/css" href="common/style1.css"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">4.Retrieval of <span class="application">Zebra</span> internal record data</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="architecture-workflow.html">Prev</a></td><th width="60%" align="center">Chapter4.Overview of <span class="application">Zebra</span> Architecture</th><td width="20%" align="right"><a accesskey="n" href="querymodel.html">Next</a></td></tr></table><hr></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="special-retrieval"></a>4.Retrieval of <span class="application">Zebra</span> internal record data</h2></div></div></div><p>
Starting with <code class="literal"><span class="application">Zebra</span></code> version 2.0.5 or newer, it is
possible to use a special element set which has the prefix
<code class="literal">zebra::</code>.
</p><p>
Using this element will, regardless of record type, return
<span class="application">Zebra</span>'s internal index structure/data for a record.
In particular, the regular record filters are not invoked when
these are in use.
This can in some cases make the retrieval faster than regular
retrieval operations (for <acronym class="acronym">MARC</acronym>, <acronym class="acronym">XML</acronym> etc).
</p><div class="table"><a name="special-retrieval-types"></a><p class="title"><b>Table4.1.Special Retrieval Elements</b></p><div class="table-contents"><table class="table" summary="Special Retrieval Elements" border="1"><colgroup><col><col></colgroup><thead><tr><th>Element Set</th><th>Description</th><th>Syntax</th></tr></thead><tbody><tr><td><code class="literal">zebra::meta::sysno</code></td><td>Get <span class="application">Zebra</span> record system ID</td><td><acronym class="acronym">XML</acronym> and <acronym class="acronym">SUTRS</acronym></td></tr><tr><td><code class="literal">zebra::data</code></td><td>Get raw record</td><td>all</td></tr><tr><td><code class="literal">zebra::meta</code></td><td>Get <span class="application">Zebra</span> record internal metadata</td><td><acronym class="acronym">XML</acronym> and <acronym class="acronym">SUTRS</acronym></td></tr><tr><td><code class="literal">zebra::index</code></td><td>Get all indexed keys for record</td><td><acronym class="acronym">XML</acronym> and <acronym class="acronym">SUTRS</acronym></td></tr><tr><td>
<code class="literal">zebra::index::</code><em class="replaceable"><code>f</code></em>
</td><td>
Get indexed keys for field <em class="replaceable"><code>f</code></em> for record
</td><td><acronym class="acronym">XML</acronym> and <acronym class="acronym">SUTRS</acronym></td></tr><tr><td>
<code class="literal">zebra::index::</code><em class="replaceable"><code>f</code></em>:<em class="replaceable"><code>t</code></em>
</td><td>
Get indexed keys for field <em class="replaceable"><code>f</code></em>
and type <em class="replaceable"><code>t</code></em> for record
</td><td><acronym class="acronym">XML</acronym> and <acronym class="acronym">SUTRS</acronym></td></tr><tr><td>
<code class="literal">zebra::snippet</code>
</td><td>
Get snippet for record for one or more indexes (f1,f2,..).
This includes a phrase from the original
record at the point where a match occurs (for a query). By default
give terms before - and after are included in the snippet. The
matching terms are enclosed within element
<code class="literal"><s></code>. The snippet facility requires
Zebra 2.0.16 or later.
</td><td><acronym class="acronym">XML</acronym> and <acronym class="acronym">SUTRS</acronym></td></tr><tr><td>
<code class="literal">zebra::facet::</code><em class="replaceable"><code>f1</code></em>:<em class="replaceable"><code>t1</code></em>,<em class="replaceable"><code>f2</code></em>:<em class="replaceable"><code>t2</code></em>,..
</td><td>
Get facet of a result set. The facet result is returned
as if it was a normal record, while in reality is a
recap of most "important" terms in a result set for the fields
given.
The facet facility first appeared in Zebra 2.0.20.
</td><td><acronym class="acronym">XML</acronym></td></tr></tbody></table></div></div><br class="table-break"><p>
For example, to fetch the raw binary record data stored in the
zebra internal storage, or on the filesystem, the following
commands can be issued:
</p><pre class="screen">
Z> f @attr 1=title my
Z> format xml
Z> elements zebra::data
Z> s 1+1
Z> format sutrs
Z> s 1+1
Z> format usmarc
Z> s 1+1
</pre><p>
</p><p>
The special
<code class="literal">zebra::data</code> element set name is
defined for any record syntax, but will always fetch
the raw record data in exactly the original form. No record syntax
specific transformations will be applied to the raw record data.
</p><p>
Also, <span class="application">Zebra</span> internal metadata about the record can be accessed:
</p><pre class="screen">
Z> f @attr 1=title my
Z> format xml
Z> elements zebra::meta::sysno
Z> s 1+1
</pre><p>
displays in <code class="literal"><acronym class="acronym">XML</acronym></code> record syntax only internal
record system number, whereas
</p><pre class="screen">
Z> f @attr 1=title my
Z> format xml
Z> elements zebra::meta
Z> s 1+1
</pre><p>
displays all available metadata on the record. These include system
number, database name, indexed filename, filter used for indexing,
score and static ranking information and finally bytesize of record.
</p><p>
Sometimes, it is very hard to figure out what exactly has been
indexed how and in which indexes. Using the indexing stylesheet of
the Alvis filter, one can at least see which portion of the record
went into which index, but a similar aid does not exist for all
other indexing filters.
</p><p>
The special
<code class="literal">zebra::index</code> element set names are provided to
access information on per record indexed fields. For example, the
queries
</p><pre class="screen">
Z> f @attr 1=title my
Z> format sutrs
Z> elements zebra::index
Z> s 1+1
</pre><p>
will display all indexed tokens from all indexed fields of the
first record, and it will display in <code class="literal"><acronym class="acronym">SUTRS</acronym></code>
record syntax, whereas
</p><pre class="screen">
Z> f @attr 1=title my
Z> format xml
Z> elements zebra::index::title
Z> s 1+1
Z> elements zebra::index::title:p
Z> s 1+1
</pre><p>
displays in <code class="literal"><acronym class="acronym">XML</acronym></code> record syntax only the content
of the zebra string index <code class="literal">title</code>, or
even only the type <code class="literal">p</code> phrase indexed part of it.
</p><div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>
Trying to access numeric <code class="literal"><acronym class="acronym">BIB-1</acronym></code> use
attributes or trying to access non-existent zebra intern string
access points will result in a Diagnostic 25: Specified element set
'name not valid for specified database.
</p></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="architecture-workflow.html">Prev</a></td><td width="20%" align="center"><a accesskey="u" href="architecture.html">Up</a></td><td width="40%" align="right"><a accesskey="n" href="querymodel.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">3.Indexing and Retrieval Workflow</td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top">Chapter5.Query Model</td></tr></table></div></body></html>
|