X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=doc%2Fquerymodel.xml;h=6aa9db4c23f08aca51a9bbf63e824e4aa1c3b6f4;hb=25801551c8321842e7b0c2a65925692ccf63a9e4;hp=c7ebc179395a2bde2962fbf98fec157d817f73e4;hpb=8d4fd86574ab7de92b916c99073550348eb778f1;p=idzebra-moved-to-github.git diff --git a/doc/querymodel.xml b/doc/querymodel.xml index c7ebc17..6aa9db4 100644 --- a/doc/querymodel.xml +++ b/doc/querymodel.xml @@ -1,11 +1,10 @@ - + Query Model - Query Model Overview + Query Model Overview - Query Languages @@ -25,43 +24,42 @@ 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 representaion in the - Prefix Query Format, short - PQF, which mappes - 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 explanaitions and - descriptions of Zebra's capabilities. - - - - Common Query Language (CQL) + + + + Prefix Query Format (PQF) - 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. + 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) - Zebra can be configured to understand and map CQL to PQF. See - . - - + 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 + . + + @@ -86,21 +84,21 @@ 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 embeddes the explain operation - by perfoming a + The Z39.50 embeds the explain operation + by performing a search in the magic IR-Explain-1 database; see . - In SRU, explain is an entirely seperate - operation, which returns an Zeerex + In SRU, explain is an entirely separate + operation, which returns an ZeeRex XML record according to the structure defined by the protocol. @@ -134,9 +132,9 @@ It provides the means to investigate the content of specific indexes. - Scanning an index returns a handfull of terms actually fond in + Scanning an index returns a handful of terms actually found in the indexes, and in addition the scan - operation returns th enumber of documents indexed by each term. + 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. @@ -149,12 +147,13 @@ - Prefix Query Format structure and syntax + Prefix Query Format syntax 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. @@ -219,9 +218,10 @@ GILS gils - Extention to the Bib1 attribute set. + Extension to the Bib1 attribute set. predefined + - The use attributes (type 1) of the predefined attribute sets can - be reconfigured by tweaking the files - tab/*.att. - New attribute sets can be defined by adding similar files in the - configuration path of the server. + The use attributes (type 1) mappings the + predefined attribute sets are found in the + attribute set configuration files tab/*.att. @@ -252,19 +251,22 @@ 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. - @@ -279,7 +281,7 @@ - + - +
Boolean operators
@and binary AND operatorSet complement of two atomic queries hit sets
@proxbinary PROXIMY operatorbinary 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 @@ -305,7 +307,7 @@ Querying for the intersection of all documents containing the terms information AND retrieval: - The hit set is a subset of the coresponding + The hit set is a subset of the corresponding OR query. Z> find @and information retrieval @@ -315,19 +317,21 @@ Querying for the intersection of all documents containing the terms information AND retrieval, taking proximity into account: - The hit set is a subset of the coresponding - AND query. + The hit set is a subset of the corresponding + AND query + (see the PQF grammar for + details on the proximity operator): - Z> find @prox information retrieval + Z> find @prox 0 3 0 2 k 2 information retrieval Querying for the intersection of all documents containing the terms information AND retrieval, in the same order and near each - other as described in the term list - The hit set is a subset of the coresponding - PROXIMY query. + other as described in the term list. + The hit set is a subset of the corresponding + PROXIMITY query. Z> find "information retrieval" @@ -338,14 +342,15 @@ Atomic queries (APT) - Atomic queries are the query parts which work on one acess point + 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 Attributes-Plus-Terms (APT) queries. - Unsupplied non-use attributes type 2-9 are either inherited from + Atomic (APT) queries are always leaf nodes in the PQF query tree. + UN-supplied non-use attributes type 2-9 are either inherited from higher nodes in the query tree, or are set to Zebra's default values. See for details. @@ -353,21 +358,25 @@ - - - + + - + +
Atomic queries
attribute list
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.
term
term single term or quoted term list Here the search terms or list of search terms is added @@ -377,27 +386,43 @@
Querying for the term information in the - default index using the default attribite set, the server choice + default index using the default attribute set, the server choice of access point/index, and the default non-use attributes. - Z> find "information" + Z> find information Equivalent query fully specified including all default values: - Z> find @attrset bib-1 @attr 1=1017 @attr 2=3 @attr 3=3 @attr 4=1 @attr 5=100 @attr 6=1 "information" + Z> find @attrset bib-1 @attr 1=1017 @attr 2=3 @attr 3=3 @attr 4=1 @attr 5=100 @attr 6=1 information - + - Finding all documents which have empty titles. Notice that the - empty term must be quoted, but is otherwise legal. + Finding all documents which have the term + debussy in the title field. - Z> find @attr 1=4 "" + Z> find @attr 1=4 debussy + + 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. + + + + 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: + + Z> scan @attr 1=4 debussy + +
@@ -405,13 +430,15 @@ Named Result Sets Named result sets are supported in Zebra, and result sets can be - used as operands without limitations. + 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. After the execution of a search, the result set is available at the server, such that the client can use it for subsequent searches or retrieval requests. The Z30.50 standard actually - stresses the fact that result sets are voliatile. It may cease + stresses the fact that result sets are volatile. It may cease to exist at any time point after search, and the server will send a diagnostic to the effect that the requested result set does not exist any more. @@ -419,7 +446,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 ... @@ -428,51 +457,51 @@ 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 acessing a Zebra server by + named result sets does not exist when accessing a Zebra server by the SRU protocol. - Zebra's special use attribute type 1 of form 'string' + Zebra's special access point of type 'string' The numeric use (type 1) attribute is usually - refered to from a given + referred to from a given attribute set. In addition, Zebra let you use any internal index name defined in your configuration - as use atribute value. This is a great feature for + as use attribute value. This is a great feature for debugging, and when you do - not need the complecity of defined use attribute values. It is + not need the complexity of defined use attribute values. It is 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 name. + retrieval" in an Zebra index, using it's internal full string + name. Scanning the same index. Z> find @attr 1=sometext "information retrieval" + Z> scan @attr 1=sometext aterm - Searching the bib-1 use attribute 54 using it's string name: + Searching or scanning + the bib-1 use attribute 54 using it's string name: Z> find @attr 1=Code-language eng + Z> scan @attr 1=Code-language "" - Searching in any silly string index - if it's defined in your + It is possible to search + in any silly string index - if it's defined in your indexation rules and can be parsed by the PQF parser. This is definitely not the recommended use of this facility, as it might confuse your users with some very @@ -482,29 +511,29 @@
- See for details, and + See also for details, and - for the SRU PQF query extention using string names as a fast + for the SRU PQF query extension using string names as a fast debugging facility. - Zebra's special use attribute type 1 of form '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) - string attributes which in appearence + string attributes which in appearance resemble XPath queries. There are two problems with this approach: first, the XPath-look-alike has to be defined at indexation time, no new undefined XPath queries can entered at search time, and second, it might confuse users very much that an XPath-alike index name in fact gets populated from a possible entirely different XML element - than it pretends to acess. + than it pretends to access. When using the GRS Record Model @@ -515,7 +544,7 @@ use (type 1) xpath attributes. You must enable the xpath enable directive in your - .abs config files. + .abs configuration files. Only a very restricted subset of the @@ -528,14 +557,14 @@ Finding all documents which have the term "content" inside a text node found in a specific XML DOM subtree, whose starting element is - adressed by XPath. + addressed by XPath. Z> find @attr 1=/root content Z> find @attr 1=/root/first content Notice that the XPath must be absolute, i.e., must start with '/', and that the - XPath decendant-or-self axis followed by a + XPath descendant-or-self axis followed by a text node selection text() is implicitly appended to the stated XPath. @@ -546,15 +575,25 @@ + + Searching inside attribute strings is possible: + + Z> find @attr 1=/link/@creator morten + + + - Filter the adressing XPath by a predicate working on exact + 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'] + /record/title[@lang='en']. And similar + predicate filtering. Z> find @attr 1=/record/title[@lang='en'] english + Z> find @attr 1=/link[@creator='sisse'] sibelius + Z> find @attr 1=/link[@creator='sisse']/description[@xml:lang='da'] sibelius @@ -571,13 +610,12 @@ with '{ }' to prevent syntax errors: Z> find @attr {1=/root/first[@attr='danish']} content - Z> find @attr {1=/root/second[@attr='danish lake']} - Z> find @attr {1=/root/third[@attr='dansk s\xc3\xb8']} + Z> find @attr {1=/record/@set} oai It is worth mentioning that these dynamic performed XPath - queries are a performance bottelneck, as no optimized + 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. @@ -591,8 +629,8 @@ Explain Attribute Set The Z39.50 standard defines the - Explainattribute set - exp-1, which is used to discover information + Explain attribute set + Exp-1, which is used to discover information about a server's search semantics and functional capabilities Zebra exposes a "classic" Explain database by base name IR-Explain-1, which @@ -600,7 +638,7 @@ The attribute-set exp-1 consists of a single - Use (type 1) attribute. + use attribute (type 1). In addition, the non-Use @@ -615,7 +653,7 @@ Use Attributes (type = 1) - The following Explain search atributes are supported: + The following Explain search attributes are supported: ExplainCategory (@attr 1=1), DatabaseName (@attr 1=3), DateAdded (@attr 1=9), @@ -638,7 +676,7 @@ Explain searches with yaz-client Classic Explain only defines retrieval of Explain information - via ASN.1. Pratically no Z39.50 clients supports this. Fortunately + via ASN.1. Practically no Z39.50 clients supports this. Fortunately they don't have to - Zebra allows retrieval of this information in other formats: SUTRS, XML, @@ -725,7 +763,7 @@ 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 + found at . The BIB-1 Attribute Set Semantics from 1995, also in an updated Bib-1 Attribute Set @@ -740,7 +778,7 @@ A use attribute specifies an access point for any atomic query. - These acess points are highly dependent on the attribute set used + These access points are highly dependent on the attribute set used in the query, and are user configurable using the following default configuration files: tab/bib1.att, @@ -753,19 +791,19 @@ - In addition, Zebra allows the acess of + In addition, Zebra allows the access of internal index names and dynamic - XPath as use attributes. - See and - for - alternative acess to the Zebra internal index names and XPath queries. + XPath as use attributes; see + and + . Phrase search for information retrieval in - the title-register: + the title-register, scanning the same register afterwards: Z> find @attr 1=4 "information retrieval" + Z> scan @attr 1=4 information @@ -846,33 +884,81 @@
AlwaysMatches 103unsupportedsupported
+ 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 + this case, ordering is numerical. See + . + + Z> find @attr 1=Title @attr 2=1 music + ... + Number of hits: 11745, setno 1 + ... + Z> find @attr 1=Title @attr 2=2 music + ... + Number of hits: 11771, setno 2 + ... + Z> find @attr 1=Title @attr 2=3 music + ... + Number of hits: 532, setno 3 + ... + Z> find @attr 1=Title @attr 2=4 music + ... + Number of hits: 11463, setno 4 + ... + Z> find @attr 1=Title @attr 2=5 music + ... + Number of hits: 11419, setno 5 + + + + The relation attribute - relevance (102) is supported, see + Relevance (102) is supported, see for full information. - - - All ordering operations are based on a lexicographical ordering, - expect when the - structure attribute numeric (109) is used. In - this case, ordering is numerical. See - . - + + Ranked search for information retrieval in + the title-register: + + Z> find @attr 1=4 @attr 2=102 "information retrieval" + + - Ranked search for information retrieval in - the title-register: - - Z> find @attr 1=4 @attr 2=102 "information retrieval" - - + The relation attribute + AlwaysMatches (103) is in the default + configuration + supported in conjecture with structure attribute + Phrase (1) (which may be omitted by + default). + It can be configured to work with other structure attributes, + see the configuration file + tab/default.idx and + . +
+ + 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. + + Z> find @attr 1=Title @attr 2=103 "" + Z> find @attr 1=Title @attr 2=103 @attr 4=1 "" + + + + @@ -935,9 +1021,9 @@ The possible values of the structure attribute (type 4) can be defined - using the configuraiton file + using the configuration file tab/default.idx. - The default configuration is summerized in this table. + The default configuration is summarized in this table.
-
+ + + + The structure attribute values + Word list (6) + is supported, and maps to the boolean AND + combination of words supplied. The word list is useful when + google-like bag-of-word queries need to be translated from a GUI + query language to PQF. For example, the following queries + are equivalent: + + Z> find @attr 1=Title @attr 4=6 "mozart amadeus" + Z> find @attr 1=Title @and mozart amadeus + + + + + The structure attribute value + Free-form-text (105) and + Document-text (106) + are supported, and map both to the boolean OR + combination of words supplied. The following queries + are equivalent: + + Z> find @attr 1=Body-of-text @attr 4=105 "bach salieri teleman" + Z> find @attr 1=Body-of-text @attr 4=106 "bach salieri teleman" + Z> find @attr 1=Body-of-text @or bach @or salieri teleman + + This OR list of terms is very useful in + combination with relevance ranking: + + Z> find @attr 1=Body-of-text @attr 2=102 @attr 4=105 "bach salieri teleman" + + - The structure attribute value local-number - (107) - is supported, and maps always to the Zebra internal document ID. - + The structure attribute value + Local number (107) + 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: + + Z> find @attr 4=107 10 + Z> find @attr 1=4 @attr 4=107 10 + Z> find @attr 1=1010 @attr 4=107 10 + + - For example, in + In the GILS schema (gils.abs), the west-bounding-coordinate is indexed as type n, and is therefore searched by specifying @@ -1054,13 +1180,20 @@ 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 + . + + + Truncation Attributes (type = 5) The truncation attribute specifies whether variations of one or - more characters are allowed between serch term and hit terms, or + more characters are allowed between search term and hit terms, or not. Using non-default truncation attributes will broaden the document hit set of a search query. @@ -1116,50 +1249,200 @@ - Truncation attribute value - Process # in search term (100) is a + The truncation attribute values 1-3 perform the obvious way: + + Z> scan @attr 1=Body-of-text schnittke + ... + * schnittke (81) + schnittkes (31) + schnittstelle (1) + ... + Z> find @attr 1=Body-of-text @attr 5=1 schnittke + ... + Number of hits: 95, setno 7 + ... + Z> find @attr 1=Body-of-text @attr 5=2 schnittke + ... + Number of hits: 81, setno 6 + ... + Z> find @attr 1=Body-of-text @attr 5=3 schnittke + ... + Number of hits: 95, setno 8 + + + + + The truncation attribute value + Process # in search term (101) is a poor-man's regular expression search. It maps each # to .*, and - performes then a Regexp-1 (102) regular - expression search. + performs then a Regexp-1 (102) regular + expression search. The following two queries are equivalent: + + Z> find @attr 1=Body-of-text @attr 5=101 schnit#ke + Z> find @attr 1=Body-of-text @attr 5=102 schnit.*ke + ... + Number of hits: 89, setno 10 + + - Truncation attribute value + The truncation attribute value Regexp-1 (102) is a normal regular search, - see. + see for details. + + Z> find @attr 1=Body-of-text @attr 5=102 schnit+ke + Z> find @attr 1=Body-of-text @attr 5=102 schni[a-t]+ke + + - Truncation attribute value - Regexp-2 (103) is a Zebra specific extention + The truncation attribute value + 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 search term by one character substitution, addition, deletion or - change of posiiton. + change of position. + + Z> find @attr 1=Body-of-text @attr 5=100 schnittke + ... + Number of hits: 81, setno 14 + ... + Z> find @attr 1=Body-of-text @attr 5=103 schnittke + ... + Number of hits: 103, setno 15 + ... + - Completeness Attributes (type = 6) + + + + The Completeness Attributes (type = 6) + is used to specify that a given search term or term list is either + part of the terms of a given index/field + (Incomplete subfield (1)), or is + what literally is found in the entire field's index + (Complete field (3)). + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Completeness Attributes (type = 6)
CompletenessValueNotes
Incomplete subfield1default
Complete subfield2depreciated
Complete field3supported
+ + + The Completeness Attributes (type = 6) + is only partially and conditionally + supported in the sense that it is ignored if the hit index is + not of structure type="w" or + type="p". + + + Incomplete subfield (1) is the default, and + makes Zebra use + register type="w", whereas + Complete field (3) triggers + search and scan in index type="p". + - This attribute is ONLY used if structure w, p is to be - chosen. completeness is ignorned if not w, p is to be - used.. - Incomplete field(1) is the default and makes Zebra use - register type w. - complete subfield(2) and complete field(3) both triggers - search field type p. + The Complete subfield (2) is a reminiscens + from the happy MARC + 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 + . +
+ +
+ + + + Advanced Zebra PQF Features + + 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. + There are also the special + string type index names for the + idxpath attribute set. + + + Zebra specific retrieval of all records + + 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 + AlwaysMatches (103). + + + The _ALLRECORDS index name is used for total database + export. The search term is ignored, it may be empty. + + Z> find @attr 1=_ALLRECORDS @attr 2=103 "" + + + + Combination with other index types can be made. For example, to + find all records which are not indexed in + the Title register, issue one of the two + equivalent queries: + + Z> find @not @attr 1=_ALLRECORDS @attr 2=103 "" @attr 1=Title @attr 2=103 "" + Z> find @not @attr 1=_ALLRECORDS @attr 2=103 "" @attr 1=4 @attr 2=103 "" + + + + 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 Extentions to all Attribute Sets + Zebra specific Search Extensions to all Attribute Sets - Zebra extends the Bib1 attribute types, and these extentions are + Zebra extends the Bib1 attribute types, and these extensions are recognized regardless of attribute set used in a search operation query. @@ -1167,7 +1450,7 @@ - + @@ -1211,7 +1494,7 @@
Zebra Search Attribute ExtentionsZebra Search Attribute Extensions
Name
- Zebra Extention Embedded Sort Attribute (type 7) + Zebra Extension Embedded Sort Attribute (type 7) The embedded sort is a way to specify sort within a query - thus @@ -1219,6 +1502,15 @@ faster and does not require clients to deal with the Sort Facility. + + + All ordering operations are based on a lexicographical ordering, + expect when the + structure attribute numeric (109) is used. In + this case, ordering is numerical. See + . + + The possible values after attribute type 7 are 1 ascending and @@ -1244,7 +1536,7 @@ - Zebra Extention Term Set Attribute (type 8) + Zebra Extension Term Set Attribute (type 8) The Term Set feature is a facility that allows a search to store @@ -1267,7 +1559,7 @@ - Zebra Extention Rank Weight Attribute (type 9) + Zebra Extension Rank Weight Attribute (type 9) Rank weight is a way to pass a value to a ranking algorithm - so @@ -1283,10 +1575,10 @@ - Zebra Extention Approximative Limit Attribute (type 9) + Zebra Extension Approximative Limit Attribute (type 9) - Newer Zebra versions normally estemiates hit count for every APT + Newer Zebra versions normally estimate 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. @@ -1297,14 +1589,14 @@ reached. A value of zero means exact hit count. - For example, we might be intersted in exact hit count for a, but + 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 9=1000 b - The estimated hit count fascility makes searches faster, as one + The estimated hit count facility makes searches faster, as one only needs to process large hit lists partially. @@ -1312,11 +1604,11 @@ documents in the hit lists need to be examined for scoring and re-sorting. It is an experimental - extention. Do not use in production code. + extension. Do not use in production code. - Zebra Extention Term Reference Attribute (type 10) + Zebra Extension Term Reference Attribute (type 10) Zebra supports the searchResult-1 facility. @@ -1340,16 +1632,16 @@ - Zebra specific Scan Extentions to all Attribute Sets + Zebra specific Scan Extensions to all Attribute Sets - Zebra extends the Bib1 attribute types, and these extentions are + Zebra extends the Bib1 attribute types, and these extensions are recognized regardless of attribute set used in a scan operation query. - + @@ -1375,7 +1667,7 @@
Zebra Scan Attribute ExtentionsZebra Scan Attribute Extensions
Name
- Zebra Extention Result Set Narrow (type 8) + Zebra Extension Result Set Narrow (type 8) If attribute Result Set Narrow (type 8) @@ -1388,7 +1680,7 @@ the case of scanning all title fields around the scanterm mozart, then refining the scan by issuing a filtering query for amadeus to - restric the scan to the result set of the query: + restrict the scan to the result set of the query: Z> scan @attr 1=4 mozart ... @@ -1416,11 +1708,11 @@ - Zebra Extention Approximative Limit (type 9) + Zebra Extension Approximative Limit (type 9) - The Zebra Extention Approximative Limit (type - 9) is a way to enable approx + 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. @@ -1448,9 +1740,9 @@ This feature is enabled when defining the xpath enable option in the GRS filter - *.abs configuration files. If one wants to use + *.abs configuration files. If one wants to use the special idxpath numeric attribute set, the - main Zebra configuraiton file zebra.cfg + main Zebra configuration file zebra.cfg directive attset: idxpath.att must be enabled. The idxpath is depreciated, may not be @@ -1462,11 +1754,9 @@ IDXPATH Use Attributes (type = 1) This attribute set allows one to search GRS filter indexed - records by XPATH like structured index names. It is enabled by - specifying the + records by XPATH like structured index names. - The idxpath option defines hard-coded index names, which might clash with your own index names. @@ -1564,112 +1854,271 @@ - Combining usual bib-1 attribut set searches + Combining usual bib-1 attribute set searches with idxpath attribute set searches: Z> find @and @attr idxpath 1=1 @attr 4=3 link/ @attr 1=4 mozart Z> find @and @attr 1=_XPATH_BEGIN @attr 4=3 link/ @attr 1=_XPATH_CDATA mozart + + Scanning is supported on all idxpath + indexes, both specified as numeric use attributes, or as string + index names. + + Z> scan @attrset idxpath @attr 1=1016 text + Z> scan @attr 1=_XPATH_ATTR_CDATA anothertext + Z> scan @attrset idxpath @attr 1=3 @attr 4=3 '' + +
- - Mapping from Bib1 Attributes to Zebra internal + <sect2 id="querymodel-pqf-apt-mapping"> + <title>Mapping from PQF atomic APT queries to Zebra internal register indexes - TO-DO - - - - + The rules for PQF APT mapping are rather tricky to grasp in the + first place. We deal first with the rules for deciding which + internal register or string index to use, according to the use + attribute or access point specified in the query. Thereafter we + deal with the rules for determining the correct structure type of + the named register. +
- + + Mapping of PQF APT access points - Use attributes are interpreted according to the - attribute sets which have been loaded in the - zebra.cfg file, and are matched against specific - 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 Any is assumed. + 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. - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Access point name mapping
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. + + + + Numeric use attributes are mapped + 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. + + + + According to normalization and numeric + use attribute mapping, it follows that the following + PQF queries are considered equivalent (assuming the default + configuration has not been altered): + + Z> find @attr 1=Body-of-text serenade + Z> find @attr 1=bodyoftext serenade + Z> find @attr 1=BodyOfText serenade + Z> find @attr 1=bO-d-Y-of-tE-x-t serenade + Z> find @attr 1=1010 serenade + Z> find @attrset Bib-1 @attr 1=1010 serenade + Z> find @attrset bib1 @attr 1=1010 serenade + Z> find @attrset Bib1 @attr 1=1010 serenade + Z> find @attrset b-I-b-1 @attr 1=1010 serenade + + + + + The numerical + use attributes (type 1) + are interpreted according to the + attribute sets which have been loaded in the + zebra.cfg file, and are matched against specific + 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 + can be reconfigured by tweaking the configuration files + tab/*.att, and + new attribute sets can be defined by adding similar files in the + configuration path profilePath of the server. + + + + 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 + used indexing filter configuration files, for example in the + GRS + *.abs configuration files, or in the + alvis filter XSLT indexing stylesheets. + + + + 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, + all uppercase and + must start with the character '_'. + + + + Finally, XPATH access points are only + 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 + XPATH engine. See . + + + + +
+ + + + Mapping of PQF APT structure and completeness to + register type + + 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 rule sets. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Structure and completeness mapping to register types
StructureCompletenessRegister typeNotes
+ 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) + 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 + matches +
urx (@attr 4=104)ignoredURX/URL ('u')Special index for URL web addresses
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
+ + + If a Structure attribute of Phrase is used in conjunction with a @@ -1678,9 +2127,23 @@ against the contents of the phrase (long word) register, if one exists for the given Use attribute. A phrase register is created for those fields in the - .abs file that contains a + GRS *.abs file that contains a p-specifier. - + + Z> scan @attr 1=Title @attr 4=1 @attr 6=3 beethoven + ... + bayreuther festspiele (1) + * beethoven bibliography database (1) + benny carter (1) + ... + Z> find @attr 1=Title @attr 4=1 @attr 6=3 "beethoven bibliography" + ... + Number of hits: 0, setno 5 + ... + Z> find @attr 1=Title @attr 4=1 @attr 6=3 "beethoven bibliography database" + ... + Number of hits: 1, setno 6 + @@ -1691,7 +2154,23 @@ contains multiple words, the term will only match if all of the words are found immediately adjacent, and in the given order. The word search is performed on those fields that are indexed as - type w in the .abs file. + type w in the GRS *.abs file. + + Z> scan @attr 1=Title @attr 4=1 @attr 6=1 beethoven + ... + beefheart (1) + * beethoven (18) + beethovens (7) + ... + Z> find @attr 1=Title @attr 4=1 @attr 6=1 beethoven + ... + Number of hits: 18, setno 1 + ... + Z> find @attr 1=Title @attr 4=1 @attr 6=1 "beethoven bibliography" + ... + Number of hits: 2, setno 2 + ... + @@ -1702,21 +2181,22 @@ natural-language, relevance-ranked query. This search type uses the word register, i.e. those fields that are indexed as type w in the - .abs file. + GRS *.abs file. If the Structure attribute is Numeric String the term is treated as an integer. The search is performed on those fields that are indexed - as type n in the .abs file. + as type n in the GRS + *.abs file. If the Structure attribute is - URx the term is treated as a URX (URL) entity. + URX the term is treated as a URX (URL) entity. The search is performed on those fields that are indexed as type - u in the .abs file. + u in the *.abs file. @@ -1751,6 +2231,8 @@ replacement) is accepted when terms are matched against the register contents. + +
@@ -1841,6 +2323,8 @@ The next plus character marks the end of the section. Currently Zebra only supports one specifier, the error tolerance, which consists one digit. +