X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=doc%2Fquerymodel.xml;h=afdb4078ceae66d6eb96dc5f100c4e03a8c6dfb9;hb=5ca4e60e990af6ad6b62ebff855d7b642f37c3ec;hp=ee170612f843dcf06c8dda7fd57f3cebec968528;hpb=3f97d3b682ee70a2b523b67153a83e9545d1b610;p=idzebra-moved-to-github.git diff --git a/doc/querymodel.xml b/doc/querymodel.xml index ee17061..afdb407 100644 --- a/doc/querymodel.xml +++ b/doc/querymodel.xml @@ -1,20 +1,20 @@ - + Query Model - +
Query Model Overview - - + +
Query Languages - Zebra is born as a networking Information Retrieval engine adhering + &zebra; is born as a networking Information Retrieval engine adhering to the international standards Z39.50 and SRU, and implement the - type-1 Reverse Polish Notation (RPN) query + type-1 Reverse Polish Notation (RPN) query model defined there. Unfortunately, this model has only defined a binary encoded representation, which is used as transport packaging in @@ -22,59 +22,58 @@ readable, nor defines any convenient way to specify queries. - Since the type-1 (RPN) + Since the type-1 (RPN) query structure has no direct, useful string - representation, every origin application needs to provide some + representation, every client application needs to provide some form of mapping from a local query notation or representation to it. - - - - - Prefix Query Format (PQF) - - - Index Data has defined a textual representation in the - Prefix Query Format, short - PQF, which maps - one-to-one to binary encoded - type-1 RPN query packages. - It has been adopted by other - parties developing Z39.50 software, and is often referred to as - Prefix Query Notation, or in short - PQN. See - for further explanations and - descriptions of Zebra's capabilities. - - - - Common Query Language (CQL) + + +
+ Prefix Query Format (PQF) + + Index Data has defined a textual representation in the + Prefix Query Format, short + PQF, which maps + one-to-one to binary encoded + type-1 RPN queries. + PQF has been adopted by other + parties developing Z39.50 software, and is often referred to as + Prefix Query Notation, or in short + PQN. See + for further explanations and + descriptions of &zebra;'s capabilities. + +
+ +
+ Common Query Language (CQL) - The query model of the type-1 RPN, - expressed in PQF/PQN is natively supported. - On the other hand, the default SRU - webservices Common Query Language - CQL is not natively supported. + The query model of the type-1 RPN, + expressed in PQF/PQN is natively supported. + On the other hand, the default SRU + web services Common Query Language + CQL is not natively supported. - Zebra can be configured to understand and map CQL to PQF. See - . - - + &zebra; can be configured to understand and map CQL to PQF. See + . + +
- +
- +
Operation types - Zebra supports all of the three different - Z39.50/SRU operations defined in the - standards: explain, search, - and scan. A short description of the + &zebra; supports all of the three different + Z39.50/SRU operations defined in the + standards: explain, search, + and scan. A short description of the functionality and purpose of each is quite in order here. - +
Explain Operation The syntax of Z39.50/SRU queries is @@ -82,36 +81,34 @@ semantics - taking into account a particular servers functionalities and abilities - must be discovered from case to case. Enters the - explain operation, which provides the means - for learning which + explain operation, which provides the means for learning which fields (also called - indexes or access points + indexes or access points) are provided, which default parameter the server uses, which retrieve document formats are defined, and which specific parts of the general query model are supported. - The Z39.50 embeds the explain operation + The Z39.50 embeds the explain operation by performing a - search in the magic + search in the magic IR-Explain-1 database; see . - In SRU, explain is an entirely separate - operation, which returns an ZeeRex - XML record according to the + In SRU, explain is an entirely separate + operation, which returns an ZeeRex XML record according to the structure defined by the protocol. In both cases, the information gathered through - explain operations can be used to + explain operations can be used to auto-configure a client user interface to the servers capabilities. - +
- + - +
Scan Operation - The scan operation is a helper functionality, + The scan operation is a helper functionality, which operates on one index or access point a time. It provides the means to investigate the content of specific indexes. - Scanning an index returns a handful of terms actually fond in - the indexes, and in addition the scan + Scanning an index returns a handful of terms actually found in + the indexes, and in addition the scan operation returns the number of documents indexed by each term. A search client can use this information to propose proper spelling of search terms, to auto-fill search boxes, or to display controlled vocabularies. - +
- +
- +
- - Prefix Query Format syntax and semantics +
+ RPN queries and semantics - The PQF grammer + The PQF grammar is documented in the YAZ manual, and shall not be repeated here. This textual PQF representation - is always during search mapped to the equivalent Zebra internal + is not transmistted to &zebra; during search, but it is in the + client mapped to the equivalent Z39.50 binary query parse tree. - - PQF tree structure +
+ RPN tree structure - The PQF parse tree - or the equivalent textual representation - + The RPN parse tree - or the equivalent textual representation in PQF - may start with one specification of the attribute set used. Following is a query tree, which @@ -171,124 +169,124 @@ complex query trees. - +
Attribute sets Attribute sets define the exact meaning and semantics of queries - issued. Zebra comes with some predefined attribute set + issued. &zebra; comes with some predefined attribute set definitions, others can easily be defined and added to the configuration. - - - - - +
Attribute sets predefined in Zebra
+ Attribute sets predefined in &zebra; + - - - - - - - - + + Attribute set + PQF notation (Short hand) + Status + Notes + + + - - - - - - - - - - - - - - - - - - + non-use attributes (types 2-12) define the hard-wired + &zebra; internal query + processing. + default + + + GILS + gils + Extension to the Bib-1 attribute set. + predefined + +
Attribute setShort handStatusNotes
Explainexp-1Special attribute set used on the special automagic + + Explain + exp-1 + Special attribute set used on the special automagic IR-Explain-1 database to gain information on server capabilities, database names, and database - and semantics.predefined
Bib1bib-1Standard PQF query language attribute set which defines the + and semantics. + predefined + + + Bib-1 + bib-1 + Standard PQF query language attribute set which defines the semantics of Z39.50 searching. In addition, all of the - non-use attributes (type 2-9) define the hard-wired - Zebra internal query - processing.default
GILSgilsExtension to the Bib1 attribute set.predefined
- - - - The use attributes (type 1) mappings the - predefined attribute sets are found in the - attribute set configuration files tab/*.att. - - - - The Zebra internal query processing is modeled after - the Bib1 attribute set, and the non-use - attributes type 2-6 are hard-wired in. It is therefore essential - to be familiar with . - - + + + The use attributes (type 1) mappings the + predefined attribute sets are found in the + attribute set configuration files tab/*.att. + + + + + The &zebra; internal query processing is modeled after + the Bib-1 attribute set, and the non-use + attributes type 2-6 are hard-wired in. It is therefore essential + to be familiar with . + + + +
- +
Boolean operators - A pair of subquery trees, or of atomic queries, is combined + A pair of sub query trees, or of atomic queries, is combined using the standard boolean operators into new query trees. Thus, boolean operators are always internal nodes in the query tree. - - - +
Boolean operators
+ Boolean operators + - - - - - - + + Keyword + Operator + Description + + - - - - - - - - - - - - - - - - + @and + binary AND operator + Set intersection of two atomic queries hit sets + + @or + binary OR operator + Set union of two atomic queries hit sets + + @not + binary AND NOT operator + Set complement of two atomic queries hit sets + + @prox + binary PROXIMITY operator + Set intersection of two atomic queries hit sets. In + addition, the intersection set is purged for all + documents which do not satisfy the requested query + term proximity. Usually a proper subset of the AND + operation. + +
KeywordOperatorDescription
@andbinary AND operatorSet intersection of two atomic queries hit sets
@orbinary OR operatorSet union of two atomic queries hit sets
@notbinary AND NOT operatorSet complement of two atomic queries hit sets
@proxbinary PROXIMY operatorSet intersection of two atomic queries hit sets. In - addition, the intersection set is purged for all - documents which do not satisfy the requested query - term proximity. Usually a proper subset of the AND - operation.
@@ -331,58 +329,58 @@ retrieval, in the same order and near each other as described in the term list. The hit set is a subset of the corresponding - PROXIMY query. + PROXIMITY query. Z> find "information retrieval" - +
- +
Atomic queries (APT) Atomic queries are the query parts which work on one access point - only. These consist of an attribute list - followed by a single term or a - quoted term list, and are often called + only. These consist of an attribute list + followed by a single term or a + quoted term list, and are often called Attributes-Plus-Terms (APT) queries. Atomic (APT) queries are always leaf nodes in the PQF query tree. - Unsupplied non-use attributes type 2-9 are either inherited from - higher nodes in the query tree, or are set to Zebra's default values. + UN-supplied non-use attributes types 2-12 are either inherited from + higher nodes in the query tree, or are set to &zebra;'s default values. See for details. - - - +
Atomic queries (APT)
+ Atomic queries (APT) + - - - - - + + Name + Type + Notes + - - - - - - - - - - + inherited, are set to the default &zebra; configuration values. + + + + term + single term + or quoted term list + Here the search terms or list of search terms is added + to the query + +
NameTypeNotes
attribute listList of orthogonal attributesAny of the orthogonal attribute types may be omitted, + + attribute list + List of orthogonal attributes + Any of the orthogonal attribute types may be omitted, these are inherited from higher query tree nodes, or if not - inherited, are set to the default Zebra configuration values. -
termsingle term - or quoted term list Here the search terms or list of search terms is added - to the query
Querying for the term information in the @@ -408,14 +406,14 @@ - The scan operation is only supported with + The scan operation is only supported with atomic APT queries, as it is bound to one access point at a time. Boolean query trees are not allowed during - scan. + scan. - For example, we migh want to scan the title index, starting with + For example, we might want to scan the title index, starting with the term debussy, and displaying this and the following terms in lexicographic order: @@ -423,13 +421,13 @@ Z> scan @attr 1=4 debussy - +
- +
Named Result Sets - Named result sets are supported in Zebra, and result sets can be + Named result sets are supported in &zebra;, and result sets can be used as operands without limitations. It follows that named result sets are leaf nodes in the PQF query tree, exactly as atomic APT queries are. @@ -446,7 +444,9 @@ Defining a named result set and re-using it in the next query, - using yaz-client. + using yaz-client. Notice that the client, not + the server, assigns the string '1' to the + named result set. Z> f @attr 1=4 mozart ... @@ -455,39 +455,35 @@ Z> f @and @set 1 @attr 1=4 amadeus ... Number of hits: 14, setno 2 - ... - Z> f @attr 1=1016 beethoven - ... - Number of hits: 26, setno 3 - ... - Named result sets are only supported by the Z39.50 protocol. - The SRU web service is stateless, and therefore the notion of - named result sets does not exist when accessing a Zebra server by - the SRU protocol. + + Named result sets are only supported by the Z39.50 protocol. + The SRU web service is stateless, and therefore the notion of + named result sets does not exist when accessing a &zebra; server by + the SRU protocol. + - - - - - Zebra's special access point of type 'string' +
+ +
+ &zebra;'s special access point of type 'string' - The numeric use (type 1) attribute is usually + The numeric use (type 1) attribute is usually referred to from a given - attribute set. In addition, Zebra let you use + attribute set. In addition, &zebra; let you use any internal index name defined in your configuration as use attribute value. This is a great feature for debugging, and when you do not need the complexity of defined use attribute values. It is - the preferred way of accessing Zebra indexes directly. + the preferred way of accessing &zebra; indexes directly. Finding all documents which have the term list "information - retrieval" in an Zebra index, using it's internal full string + retrieval" in an &zebra; index, using it's internal full string name. Scanning the same index. Z> find @attr 1=sometext "information retrieval" @@ -515,20 +511,20 @@ See also for details, and - + for the SRU PQF query extension using string names as a fast debugging facility. - +
- - Zebra's special access point of type 'XPath' + <section id="querymodel-use-xpath"> + <title>&zebra;'s special access point of type 'XPath' for GRS filters As we have seen above, it is possible (albeit seldom a great idea) to emulate XPath 1.0 based - search by defining use (type 1) + search by defining use (type 1) string attributes which in appearance resemble XPath queries. There are two problems with this approach: first, the XPath-look-alike has to @@ -539,22 +535,24 @@ than it pretends to access. - When using the GRS Record Model - (see ), we have the + When using the GRS Record Model + (see ), we have the possibility to embed life XPath expressions in the PQF queries, which are here called - use (type 1) xpath + use (type 1) xpath attributes. You must enable the xpath enable directive in your .abs configuration files. - Only a very restricted subset of the - XPath 1.0 - standard is supported as the GRS record model is simpler than - a full XML DOM structure. See the following examples for - possibilities. + + Only a very restricted subset of the + XPath 1.0 + standard is supported as the GRS record model is simpler than + a full XML DOM structure. See the following examples for + possibilities. + Finding all documents which have the term "content" @@ -589,7 +587,7 @@ Filter the addressing XPath by a predicate working on exact string values in attributes (in the XML sense) can be done: return all those docs which - have the term "english" contained in one of all text subnodes of + have the term "english" contained in one of all text sub nodes of the subtree defined by the XPath /record/title[@lang='en']. And similar predicate filtering. @@ -610,50 +608,51 @@ Escaping PQF keywords and other non-parseable XPath constructs - with '{ }' to prevent syntax errors: + with '{ }' to prevent client-side PQF parsing + syntax errors: Z> find @attr {1=/root/first[@attr='danish']} content Z> find @attr {1=/record/@set} oai - It is worth mentioning that these dynamic performed XPath - queries are a performance bottleneck, as no optimized - specialized indexes can be used. Therefore, avoid the use of - this facility when speed is essential, and the database content - size is medium to large. + + It is worth mentioning that these dynamic performed XPath + queries are a performance bottleneck, as no optimized + specialized indexes can be used. Therefore, avoid the use of + this facility when speed is essential, and the database content + size is medium to large. + - - - - +
+
- +
Explain Attribute Set The Z39.50 standard defines the Explain attribute set - Exp-1, which is used to discover information + Exp-1, which is used to discover information about a server's search semantics and functional capabilities - Zebra exposes a "classic" + &zebra; exposes a "classic" Explain database by base name IR-Explain-1, which is populated with system internal information. The attribute-set exp-1 consists of a single - use attribute (type 1). + use attribute (type 1). In addition, the non-Use - bib-1 attributes, that is, the types - Relation, Position, - Structure, Truncation, - and Completeness are imported from - the bib-1 attribute set, and may be used + Bib-1 attributes, that is, the types + Relation, Position, + Structure, Truncation, + and Completeness are imported from + the Bib-1 attribute set, and may be used within any explain query. - +
Use Attributes (type = 1) The following Explain search attributes are supported: @@ -673,14 +672,14 @@ Z39.50 standard for more information. - +
- +
Explain searches with yaz-client Classic Explain only defines retrieval of Explain information via ASN.1. Practically no Z39.50 clients supports this. Fortunately - they don't have to - Zebra allows retrieval of this information + they don't have to - &zebra; allows retrieval of this information in other formats: SUTRS, XML, GRS-1 and ASN.1 Explain. @@ -742,7 +741,7 @@ Get attribute details record for database Default. - This query is very useful to study the internal Zebra indexes. + This query is very useful to study the internal &zebra; indexes. If records have been indexed using the alvis XSLT filter, the string representation names of the known indexes can be found. @@ -756,27 +755,26 @@ Z> find @attrset exp1 @and @attr 1=1 attributedetails @attr 1=3 Default - +
- +
- - Bib1 Attribute Set +
+ Bib-1 Attribute Set Most of the information contained in this section is an excerpt of - the ATTRIBUTE SET BIB-1 (Z39.50-1995) - SEMANTICS, - found at . The BIB-1 + the ATTRIBUTE SET BIB-1 (Z39.50-1995) SEMANTICS + found at . The Bib-1 Attribute Set Semantics from 1995, also in an updated Bib-1 Attribute Set version from 2003. Index Data is not the copyright holder of this information, except for the configuration details, the listing of - Zebra's capabilities, and the example queries. + &zebra;'s capabilities, and the example queries. - +
Use Attributes (type 1) @@ -788,13 +786,35 @@ tab/dan1.att, tab/explain.att, and tab/gils.att. + + + For example, some few Bib-1 use + attributes from the tab/bib1.att are: + + att 1 Personal-name + att 2 Corporate-name + att 3 Conference-name + att 4 Title + ... + att 1009 Subject-name-personal + att 1010 Body-of-text + att 1011 Date/time-added-to-db + ... + att 1016 Any + att 1017 Server-choice + att 1018 Publisher + ... + att 1035 Anywhere + att 1036 Author-Title-Subject + + + New attribute sets can be added by adding new tab/*.att configuration files, which need to - be sourced in the main configuration zebra.cfg. + be sourced in the main configuration zebra.cfg. - - In addition, Zebra allows the access of + In addition, &zebra; allows the access of internal index names and dynamic XPath as use attributes; see and @@ -809,15 +829,15 @@ Z> scan @attr 1=4 information - +
- +
- - Zebra general Bib1 Non-Use Attributes (type 2-6) +
+ &zebra; general Bib1 Non-Use Attributes (type 2-6) - +
Relation Attributes (type 2) @@ -827,98 +847,103 @@ side of the relation), e.g., Date-publication <= 1975. - - - - - - - - - +
Relation Attributes (type 2)
RelationValueNotes
+ Relation Attributes (type 2) + + + + Relation + Value + Notes + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + Less than + 1 + supported + + + Less than or equal + 2 + supported + + + Equal + 3 + default + + + Greater or equal + 4 + supported + + + Greater than + 5 + supported + + + Not equal + 6 + unsupported + + + Phonetic + 100 + unsupported + + + Stem + 101 + unsupported + + + Relevance + 102 + supported + + + AlwaysMatches + 103 + supported * + +
Less than1supported
Less than or equal2supported
Equal3default
Greater or equal4supported
Greater than5supported
Not equal6unsupported
Phonetic100unsupported
Stem101unsupported
Relevance102supported
AlwaysMatches103supported
- + + + AlwaysMatches searches are only supported if alwaysmatches indexing + has been enabled. See + + + - The relation attributes - 1-5 are supported and work exactly as + The relation attributes 1-5 are supported and work exactly as expected. All ordering operations are based on a lexicographical ordering, expect when the - structure attribute numeric (109) is used. In + structure attribute numeric (109) is used. In this case, ordering is numerical. See . - Z> find @attr 1=Title @attr 2=1 music + Z> find @attr 1=Title @attr 2=1 music ... Number of hits: 11745, setno 1 ... - Z> find @attr 1=Title @attr 2=2 music + Z> find @attr 1=Title @attr 2=2 music ... Number of hits: 11771, setno 2 ... - Z> find @attr 1=Title @attr 2=3 music + Z> find @attr 1=Title @attr 2=3 music ... Number of hits: 532, setno 3 ... - Z> find @attr 1=Title @attr 2=4 music + Z> find @attr 1=Title @attr 2=4 music ... Number of hits: 11463, setno 4 ... - Z> find @attr 1=Title @attr 2=5 music + Z> find @attr 1=Title @attr 2=5 music ... Number of hits: 11419, setno 5 @@ -926,7 +951,7 @@ The relation attribute - Relevance (102) is supported, see + Relevance (102) is supported, see for full information. @@ -940,10 +965,10 @@ The relation attribute - AlwaysMatches (103) is in the default + AlwaysMatches (103) is in the default configuration supported in conjecture with structure attribute - Phrase (1) (which may be omitted by + Phrase (1) (which may be omitted by default). It can be configured to work with other structure attributes, see the configuration file @@ -951,7 +976,7 @@ . - AlwaysMatches (103) is a + AlwaysMatches (103) is a great way to discover how many documents have been indexed in a given field. The search term is ignored, but needed for correct PQF syntax. An empty search term may be supplied. @@ -962,9 +987,9 @@ - +
- +
Position Attributes (type 3) @@ -972,52 +997,56 @@ within the field or subfield in which it appears. - - - - - - - - - +
Position Attributes (type 3)
PositionValueNotes
+ Position Attributes (type 3) + + + + Position + Value + Notes + - - - - - - - - - - - - - - - + + First in field + 1 + supported * + + + First in subfield + 2 + supported * + + + Any position in field + 3 + default + +
First in field 1unsupported
First in subfield2unsupported
Any position in field3default
- - - The position attribute values first in field (1), - and first in subfield(2) are unsupported. - Using them does not trigger an error, but silent defaults to - any position in field (3). - + + + + &zebra; only supports first-in-field seaches if the + firstinfield is enabled for the index + Refer to . + &zebra; does not distinguish between first in field and + first in subfield. They result in the same hit count. + Searching for first position in (sub)field in only supported in &zebra; + 2.0.2 and later. - + +
- +
Structure Attributes (type 4) The structure attribute specifies the type of search term. This causes the search to be mapped on - different Zebra internal indexes, which must have been defined + different &zebra; internal indexes, which must have been defined at index time. @@ -1029,102 +1058,101 @@ The default configuration is summarized in this table. - - - - - - - - - +
Structure Attributes (type 4)
StructureValueNotes
+ Structure Attributes (type 4) + + + + Structure + Value + Notes + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + Phrase + 1 + default + + + Word + 2 + supported + + + Key + 3 + supported + + + Year + 4 + supported + + + Date (normalized) + 5 + supported + + + Word list + 6 + supported + + + Date (un-normalized) + 100 + unsupported + + + Name (normalized) + 101 + unsupported + + + Name (un-normalized) + 102 + unsupported + + + Structure + 103 + unsupported + + + Urx + 104 + supported + + + Free-form-text + 105 + supported + + + Document-text + 106 + supported + + + Local-number + 107 + supported + + + String + 108 + unsupported + + + Numeric string + 109 + supported + +
Phrase 1default
Word2supported
Key3supported
Year4supported
Date (normalized)5supported
Word list6supported
Date (un-normalized)100unsupported
Name (normalized) 101unsupported
Name (un-normalized) 102unsupported
Structure103unsupported
Urx104supported
Free-form-text105supported
Document-text106supported
Local-number107supported
String108unsupported
Numeric string109supported
- The structure attribute values Word list (6) @@ -1161,7 +1189,7 @@ The structure attribute value Local number (107) - is supported, and maps always to the Zebra internal document ID, + is supported, and maps always to the &zebra; internal document ID, irrespectively which use attribute is specified. The following queries have exactly the same unique record in the hit set: @@ -1182,16 +1210,17 @@ Z> find @attr 4=109 @attr 2=5 @attr gils 1=2038 -114 - + - The exact mapping between PQF queries and Zebra internal indexes - and index types is explained in + + The exact mapping between PQF queries and &zebra; internal indexes + and index types is explained in . - - - - - + + +
+ +
Truncation Attributes (type = 5) @@ -1201,54 +1230,54 @@ document hit set of a search query. - - - - - - - - - +
Truncation Attributes (type 5)
TruncationValueNotes
+ Truncation Attributes (type 5) + + + + Truncation + Value + Notes + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + Right truncation + 1 + supported + + + Left truncation + 2 + supported + + + Left and right truncation + 3 + supported + + + Do not truncate + 100 + default + + + Process # in search term + 101 + supported + + + RegExpr-1 + 102 + supported + + + RegExpr-2 + 103 + supported + +
Right truncation 1supported
Left truncation2supported
Left and right truncation3supported
Do not truncate100default
Process # in search term101supported
RegExpr-1 102supported
RegExpr-2103supported
@@ -1301,7 +1330,7 @@ The truncation attribute value - Regexp-2 (103) is a Zebra specific extension + Regexp-2 (103) is a &zebra; specific extension which allows fuzzy matches. One single error in spelling of search terms is allowed, i.e., a document is hit if it includes a term which can be mapped to the used @@ -1318,9 +1347,9 @@ ... - +
- +
Completeness Attributes (type = 6) @@ -1333,33 +1362,34 @@ (Complete field (3)). - - - - - - - - +
Completeness Attributes (type = 6)
CompletenessValueNotes
+ Completeness Attributes (type = 6) + + + + Completeness + Value + Notes + - - - - - - - - - - - - - - - + + Incomplete subfield + 1 + default + + + Complete subfield + 2 + deprecated + + + Complete field + 3 + supported + +
Incomplete subfield1default
Complete subfield2depreciated
Complete field3supported
@@ -1371,7 +1401,7 @@ Incomplete subfield (1) is the default, and - makes Zebra use + makes &zebra; use register type="w", whereas Complete field (3) triggers search and scan in index type="p". @@ -1379,39 +1409,41 @@ The Complete subfield (2) is a reminiscens from the happy MARC - binary format days. Zebra does not support it, but maps silently + binary format days. &zebra; does not support it, but maps silently to Complete field (3). - The exact mapping between PQF queries and Zebra internal indexes - and index types is explained in + + The exact mapping between PQF queries and &zebra; internal indexes + and index types is explained in . - - - + + +
+
-
+ - - Advanced Zebra PQF Features +
+ Extended &zebra; RPN Features - The Zebra internal query engine has been extended to specific needs + The &zebra; internal query engine has been extended to specific needs not covered by the bib-1 attribute set query model. These extensions are non-standard and non-portable: most functional extensions are modeled over the bib-1 attribute set, - defining type 7-9 attributes. + defining type 7 and higher values. There are also the special string type index names for the idxpath attribute set. - - Zebra specific retrieval of all records +
+ &zebra; specific retrieval of all records - Zebra defines a hardwired string index name + &zebra; defines a hardwired string index name called _ALLRECORDS. It matches any record contained in the database, if used in conjunction with the relation attribute @@ -1435,112 +1467,136 @@ - The special string index _ALLRECORDS is - experimental, and the provided functionality and syntax may very - well change in future releases of Zebra. + + The special string index _ALLRECORDS is + experimental, and the provided functionality and syntax may very + well change in future releases of &zebra;. + - - +
- - Zebra specific Search Extensions to all Attribute Sets + + + + +
+ Local Approximative Limit Attribute (type 11) + + &zebra; computes - unless otherwise configured - + the exact hit count for every APT + (leaf) in the query tree. These hit counts are returned as part of + the searchResult-1 facility in the binary encoded Z39.50 search + response packages. + + + By setting an estimation limit size of the resultset of the APT + leaves, &zebra; stoppes processing the result set when the limit + length is reached. + Hit counts under this limit are still precise, but hit counts over it + are estimated using the statistics gathered from the chopped + result set. + + + Specifying a limit of 0 resuts in exact hit counts. + + + For example, we might be interested in exact hit count for a, but + for b we allow hit count estimates for 1000 and higher. + + Z> find @and a @attr 11=1000 b + + + + + The estimated hit count facility makes searches faster, as one + only needs to process large hit lists partially. + It is mostly used in huge databases, where you you want trade + exactness of hit counts against speed of execution. + + + + + Do not use approximative hit count limits + in conjunction with relevance ranking, as re-sorting of the + result set only works when the entire result set has + been processed. + + +
+
+ Global Approximative Limit Attribute (type 12) + + By default &zebra; computes precise hit counts for a query as + a whole. Setting attribute 12 makes it perform approximative + hit counts instead. It has the same semantics as + estimatehits for the . + + + The attribute (12) can occur anywhere in the query tree. + Unlike regular attributes it does not relate to the leaf (APT) + - but to the whole query. + + + + Do not use approximative hit count limits + in conjunction with relevance ranking, as re-sorting of the + result set only works when the entire result set has + been processed. + + +
-
- +
- - Zebra specific Scan Extensions to all Attribute Sets +
+ &zebra; specific Scan Extensions to all Attribute Sets - Zebra extends the Bib1 attribute types, and these extensions are + &zebra; extends the Bib1 attribute types, and these extensions are recognized regardless of attribute - set used in a scan operation query. + set used in a scan operation query. - - - - - - - - - - +
Zebra Scan Attribute Extensions
NameTypeOperationZebra version
+ &zebra; Scan Attribute Extensions + + + + Name + Type + Operation + &zebra; version + - - - - - - - - - - - - - - -
Result Set Narrow8scan1.3
Approximative Limit9scan1.4
- - - Zebra Extension Result Set Narrow (type 8) - - - If attribute Result Set Narrow (type 8) - is given for scan, the value is the name of a - result set. Each hit count in scan is - @and'ed with the result set given. - - - Consider for example - the case of scanning all title fields around the - scanterm mozart, then refining the scan by - issuing a filtering query for amadeus to - restrict the scan to the result set of the query: - + + + Result Set Narrow + 8 + scan + 1.3 + + + Approximative Limit + 9 + scan + 1.4 + + + + + +
+ &zebra; Extension Result Set Narrow (type 8) + + If attribute Result Set Narrow (type 8) + is given for scan, the value is the name of a + result set. Each hit count in scan is + @and'ed with the result set given. + + + Consider for example + the case of scanning all title fields around the + scanterm mozart, then refining the scan by + issuing a filtering query for amadeus to + restrict the scan to the result set of the query: + Z> scan @attr 1=4 mozart ... * mozart (43) @@ -1703,114 +1799,109 @@ mozartiana (0) mozarts (1) ... - - - - - Experimental. Do not use in production code. - - - - Zebra Extension Approximative Limit (type 9) - - - The Zebra Extension Approximative Limit (type - 9) is a way to enable approximate - hit counts for scan hit counts, in the same - way as for search hit counts. - - - - Experimental and buggy. Definitely not to be used in production code. - - + + + + + &zebra; 2.0.2 and later is able to skip 0 hit counts. This, however, + is known not to scale if the number of terms to skip is high. + This most likely will happen if the result set is small (and + result in many 0 hits). + +
- - +
+ &zebra; Extension Approximative Limit (type 11) + + The &zebra; Extension Approximative Limit (type 11) is a way to + enable approximate hit counts for scan hit counts, in the same + way as for search hit counts. + +
+
- - Zebra special IDXPATH Attribute Set for GRS indexing +
+ &zebra; special IDXPATH Attribute Set for GRS indexing The attribute-set idxpath consists of a single - Use (type 1) attribute. All non-use attributes - behave as normal. + Use (type 1) attribute. All non-use attributes behave as normal. This feature is enabled when defining the xpath enable option in the GRS filter *.abs configuration files. If one wants to use the special idxpath numeric attribute set, the - main Zebra configuration file zebra.cfg + main &zebra; configuration file zebra.cfg directive attset: idxpath.att must be enabled. - The idxpath is depreciated, may not be - supported in future Zebra versions, and should definitely - not be used in production code. + + + The idxpath is deprecated, may not be + supported in future &zebra; versions, and should definitely + not be used in production code. + - +
IDXPATH Use Attributes (type = 1) This attribute set allows one to search GRS filter indexed records by XPATH like structured index names. - The idxpath option defines hard-coded - index names, which might clash with your own index names. + + + The idxpath option defines hard-coded + index names, which might clash with your own index names. + - - - - - - - - - - +
Zebra specific IDXPATH Use Attributes (type 1)
IDXPATHValueString IndexNotes
+ &zebra; specific IDXPATH Use Attributes (type 1) + + + + IDXPATH + Value + String Index + Notes + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + XPATH Begin + 1 + _XPATH_BEGIN + deprecated + + + XPATH End + 2 + _XPATH_END + deprecated + + + XPATH CData + 1016 + _XPATH_CDATA + deprecated + + + XPATH Attribute Name + 3 + _XPATH_ATTR_NAME + deprecated + + + XPATH Attribute CData + 1015 + _XPATH_ATTR_CDATA + deprecated + +
XPATH Begin1_XPATH_BEGINdepreciated
XPATH End2_XPATH_ENDdepreciated
XPATH CData1016_XPATH_CDATAdepreciated
XPATH Attribute Name3_XPATH_ATTR_NAMEdepreciated
XPATH Attribute CData1015_XPATH_ATTR_CDATAdepreciated
- See tab/idxpath.att for more information. @@ -1875,12 +1966,12 @@ - - +
+
- - Mapping from PQF atomic APT queries to Zebra internal + <section id="querymodel-pqf-apt-mapping"> + <title>Mapping from PQF atomic APT queries to &zebra; internal register indexes The rules for PQF APT mapping are rather tricky to grasp in the @@ -1891,68 +1982,68 @@ the named register. - +
Mapping of PQF APT access points - Zebra understands four fundamental different types of access + &zebra; understands four fundamental different types of access points, of which only the numeric use attribute type access points are defined by the Z39.50 standard. - All other access point types are Zebra specific, and non-portable. + All other access point types are &zebra; specific, and non-portable. - - - +
Access point name mapping
+ Access point name mapping + - - - - - - + + Access Point + Type + Grammar + Notes + - - - - - - - - - - - - - - - - - - - - - - - - - -
Access PointTypeGrammarNotes
Use attributenumeric[1-9][1-9]*directly mapped to string index name
String index namestring[a-zA-Z](\-?[a-zA-Z0-9])*normalized name is used as internal string index name
Zebra internal index namezebra_[a-zA-Z](_?[a-zA-Z0-9])*hardwired internal string index name
XPATH special indexXPath/.*special xpath search for GRS indexed records
- - - Attribute set names and - string index names are normalizes - according to the following rules: all single - hyphens '-' are stripped, and all upper case - letters are folded to lower case. + + Use attribute + numeric + [1-9][1-9]* + directly mapped to string index name + + + String index name + string + [a-zA-Z](\-?[a-zA-Z0-9])* + normalized name is used as internal string index name + + + &zebra; internal index name + zebra + _[a-zA-Z](_?[a-zA-Z0-9])* + hardwired internal string index name + + + XPATH special index + XPath + /.* + special xpath search for GRS indexed records + + + + + + + Attribute set names and + string index names are normalizes + according to the following rules: all single + hyphens '-' are stripped, and all upper case + letters are folded to lower case. - + Numeric use attributes are mapped - to the Zebra internal + to the &zebra; internal string index according to the attribute set definition in use. The default attribute set is Bib-1, and may be omitted in the PQF query. @@ -1985,9 +2076,8 @@ fields as specified in the .abs file which describes the profile of the records which have been loaded. If no use attribute is provided, a default of - Bib-1 Use Any (1016) is - assumed. - The predefined use attribute sets + Bib-1 Use Any (1016) is assumed. + The predefined use attribute sets can be reconfigured by tweaking the configuration files tab/*.att, and new attribute sets can be defined by adding similar files in the @@ -1995,10 +2085,10 @@ - String indexes can be accessed directly, + String indexes can be accessed directly, independently which attribute set is in use. These are just ignored. The above mentioned name normalization applies. - String index names are defined in the + String index names are defined in the used indexing filter configuration files, for example in the GRS *.abs configuration files, or in the @@ -2006,10 +2096,10 @@ - Zebra internal indexes can be accessed directly, + &zebra; internal indexes can be accessed directly, according to the same rules as the user defined - string indexes. The only difference is that - Zebra internal index names are hardwired, + string indexes. The only difference is that + &zebra; internal index names are hardwired, all uppercase and must start with the character '_'. @@ -2019,107 +2109,107 @@ available using the GRS filter for indexing. These access point names must start with the character '/', they are not - normalized, but passed unaltered to the Zebra internal + normalized, but passed unaltered to the &zebra; internal XPATH engine. See . - +
- +
Mapping of PQF APT structure and completeness to register type - Internally Zebra has in it's default configuration several + Internally &zebra; has in it's default configuration several different types of registers or indexes, whose tokenization and character normalization rules differ. This reflects the fact that searching fundamental different tokens like dates, numbers, - bitfields and string based text needs different rulesets. + bitfields and string based text needs different rule sets. - - - +
Structure and completeness mapping to register types
+ Structure and completeness mapping to register types + - - - - - - - - - - + + phrase (@attr 4=1), word (@attr 4=2), word-list (@attr 4=6), free-form-text (@attr 4=105), or document-text (@attr 4=106) - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
StructureCompletenessRegister typeNotes
+ + Structure + Completeness + Register type + Notes + + +
Incomplete field (@attr 6=1)Word ('w')Traditional tokenized and character normalized word index
+ + Incomplete field (@attr 6=1) + Word ('w') + Traditional tokenized and character normalized word index + + + phrase (@attr 4=1), word (@attr 4=2), word-list (@attr 4=6), free-form-text (@attr 4=105), or document-text (@attr 4=106) - complete field' (@attr 6=3)Phrase ('p')Character normalized, but not tokenized index for phrase + + complete field' (@attr 6=3) + Phrase ('p') + Character normalized, but not tokenized index for phrase matches -
urx (@attr 4=104)ignoredURX/URL ('u')Special index for URL web adresses
numeric (@attr 4=109)ignoredNumeric ('u')Special index for digital numbers
key (@attr 4=3)ignoredNull bitmap ('0')Used for non-tokenizated and non-normalized bit sequences
year (@attr 4=4)ignoredYear ('y')Non-tokenizated and non-normalized 4 digit numbers
date (@attr 4=5)ignoredDate ('d')Non-tokenizated and non-normalized ISO date strings
ignoredignoredSort ('s')Used with special sort attribute set (@attr 7=1, @attr 7=2)
overruledoverruledspecialInternal record ID register, used whenever - Relation Always Matches (@attr 2=103) is specified
- + + + + urx (@attr 4=104) + ignored + URX/URL ('u') + Special index for URL web addresses + + + numeric (@attr 4=109) + ignored + Numeric ('u') + Special index for digital numbers + + + key (@attr 4=3) + ignored + Null bitmap ('0') + Used for non-tokenizated and non-normalized bit sequences + + + year (@attr 4=4) + ignored + Year ('y') + Non-tokenizated and non-normalized 4 digit numbers + + + date (@attr 4=5) + ignored + Date ('d') + Non-tokenizated and non-normalized ISO date strings + + + ignored + ignored + Sort ('s') + Used with special sort attribute set (@attr 7=1, @attr 7=2) + + + overruled + overruled + special + Internal record ID register, used whenever + Relation Always Matches (@attr 2=103) is specified + + + + + @@ -2133,7 +2223,7 @@ GRS *.abs file that contains a p-specifier. - Z> scan @attr 1=Title @attr 4=1 @attr 6=3 beethoven + Z> scan @attr 1=Title @attr 4=1 @attr 6=3 beethoven ... bayreuther festspiele (1) * beethoven bibliography database (1) @@ -2159,7 +2249,7 @@ The word search is performed on those fields that are indexed as type w in the GRS *.abs file. - Z> scan @attr 1=Title @attr 4=1 @attr 6=1 beethoven + Z> scan @attr 1=Title @attr 4=1 @attr 6=1 beethoven ... beefheart (1) * beethoven (18) @@ -2205,7 +2295,7 @@ If the Structure attribute is Local Number the term is treated as - native Zebra Record Identifier. + native &zebra; Record Identifier. @@ -2235,11 +2325,11 @@ contents. - - +
+ - - Zebra Regular Expressions in Truncation Attribute (type = 5) +
+ &zebra; Regular Expressions in Truncation Attribute (type = 5) Each term in a query is interpreted as a regular expression if @@ -2248,84 +2338,77 @@ Both query types follow the same syntax with the operands: - - - - - - - - - - - - - - - - - - -
Regular Expression Operands
xMatches the character x.
.Matches any character.
[ .. ]Matches the set of characters specified; - such as [abc] or [a-c].
+ + Regular Expression Operands + + + + x + Matches the character x. + + + . + Matches any character. + + + [ .. ] + Matches the set of characters specified; + such as [abc] or [a-c]. + + + +
The above operands can be combined with the following operators: - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Regular Expression Operators
x*Matches x zero or more times. - Priority: high.
x+Matches x one or more times. - Priority: high.
x? Matches x zero or once. - Priority: high.
xy Matches x, then y. - Priority: medium.
x|y Matches either x or y. - Priority: low.
( )The order of evaluation may be changed by using parentheses.
- + + + Regular Expression Operators + + + + x* + Matches x zero or more times. + Priority: high. + + + x+ + Matches x one or more times. + Priority: high. + + + x? + Matches x zero or once. + Priority: high. + + + xy + Matches x, then y. + Priority: medium. + + + x|y + Matches either x or y. + Priority: low. + + + ( ) + The order of evaluation may be changed by using parentheses. + + + +
+ If the first character of the Regxp-2 query is a plus character (+) it marks the beginning of a section with non-standard specifiers. The next plus character marks the end of the section. - Currently Zebra only supports one specifier, the error tolerance, + Currently &zebra; only supports one specifier, the error tolerance, which consists one digit. + @@ -2349,26 +2432,26 @@ Z> find @attr 1=4 @attr 5=102 @attr 2=102 "informat.* retrieval" - +
-
+ - +
Server Side CQL to PQF Query Translation Using the @@ -2419,23 +2502,19 @@ Exhaustive information can be found in the Section "Specification of CQL to RPN mappings" in the YAZ manual. - - http://www.indexdata.dk/yaz/doc/tools.tkl#tools.cql.map, - and shall therefore not be repeated here. + , + and shall therefore not be repeated here. - - - +