X-Git-Url: http://git.indexdata.com/?p=idzebra-moved-to-github.git;a=blobdiff_plain;f=doc%2Fquerymodel.xml;fp=doc%2Fquerymodel.xml;h=f5d69338b0addb553360fc6949b9b50d7c17565c;hp=d7a7f8489ae6cbc385672497dc1fbcea1ecf9aeb;hb=972bceaa6386f904bc3e4845f1c5598656c5c6f2;hpb=bb39ca3dd76e6339f66813bca1e64b644760e5a2 diff --git a/doc/querymodel.xml b/doc/querymodel.xml index d7a7f84..f5d6933 100644 --- a/doc/querymodel.xml +++ b/doc/querymodel.xml @@ -1,24 +1,24 @@ Query Model - +
- Query Model Overview - + Query Model Overview +
Query Languages - + &zebra; is born as a networking Information Retrieval engine adhering - to the international standards + to the international standards &acro.z3950; and &acro.sru;, - and implement the + and implement the type-1 Reverse Polish Notation (&acro.rpn;) query model defined there. Unfortunately, this model has only defined a binary encoded representation, which is used as transport packaging in the &acro.z3950; protocol layer. This representation is not human - readable, nor defines any convenient way to specify queries. + readable, nor defines any convenient way to specify queries. Since the type-1 (&acro.rpn;) @@ -26,30 +26,30 @@ representation, every client application needs to provide some form of mapping from a local query notation or representation to it. - - + +
Prefix Query Format (&acro.pqf;) - Index Data has defined a textual representation in the + Index Data has defined a textual representation in the Prefix Query Format, short - &acro.pqf;, which maps - one-to-one to binary encoded + &acro.pqf;, which maps + one-to-one to binary encoded type-1 &acro.rpn; queries. &acro.pqf; has been adopted by other parties developing &acro.z3950; software, and is often referred to as - Prefix Query Notation, or in short - &acro.pqn;. See + Prefix Query Notation, or in short + &acro.pqn;. See for further explanations and - descriptions of &zebra;'s capabilities. + descriptions of &zebra;'s capabilities. -
- +
+
Common Query Language (&acro.cql;) The query model of the type-1 &acro.rpn;, - expressed in &acro.pqf;/&acro.pqn; is natively supported. + expressed in &acro.pqf;/&acro.pqn; is natively supported. On the other hand, the default &acro.sru; web services Common Query Language &acro.cql; is not natively supported. @@ -58,8 +58,8 @@ &zebra; can be configured to understand and map &acro.cql; to &acro.pqf;. See . -
- +
+
@@ -67,9 +67,9 @@ &zebra; supports all of the three different &acro.z3950;/&acro.sru; operations defined in the - standards: explain, search, + standards: explain, search, and scan. A short description of the - functionality and purpose of each is quite in order here. + functionality and purpose of each is quite in order here.
@@ -79,38 +79,38 @@ well known to any client, but the specific 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 + discovered from case to case. Enters the + explain operation, which provides the means for learning which fields (also called 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. + of the general query model are supported. The &acro.z3950; embeds the explain operation - by performing a - search in the magic + by performing a + search in the magic IR-Explain-1 database; - see . + see . In &acro.sru;, explain is an entirely separate - operation, which returns an ZeeRex &acro.xml; record according to the + operation, which returns an ZeeRex &acro.xml; record according to the structure defined by the protocol. In both cases, the information gathered through explain operations can be used to auto-configure a client user interface to the servers - capabilities. + capabilities.
- +
&acro.rpn; queries and semantics @@ -149,24 +149,24 @@ is documented in the &yaz; manual, and shall not be repeated here. This textual &acro.pqf; representation is not transmitted to &zebra; during search, but it is in the - client mapped to the equivalent &acro.z3950; binary - query parse tree. + client mapped to the equivalent &acro.z3950; binary + query parse tree. - +
&acro.rpn; tree structure The &acro.rpn; parse tree - or the equivalent textual representation in &acro.pqf; - - may start with one specification of the + may start with one specification of the attribute set used. Following is a query - tree, which + tree, which consists of atomic query parts (&acro.apt;) or named result sets, eventually - paired by boolean binary operators, and - finally recursively combined into - complex query trees. + paired by boolean binary operators, and + finally recursively combined into + complex query trees. - +
Attribute sets @@ -175,7 +175,7 @@ definitions, others can easily be defined and added to the configuration. - + Attribute sets predefined in &zebra; @@ -187,7 +187,7 @@ Notes - + Explain @@ -203,7 +203,7 @@ bib-1 Standard &acro.pqf; query language attribute set which defines the semantics of &acro.z3950; searching. In addition, all of the - non-use attributes (types 2-14) define the hard-wired + non-use attributes (types 2-14) define the hard-wired &zebra; internal query processing. default @@ -217,24 +217,24 @@
- + The use attributes (type 1) mappings the predefined attribute sets are found in the - attribute set configuration files tab/*.att. + attribute set configuration files tab/*.att. - + - The &zebra; internal query processing is modeled after + The &zebra; internal query processing is modeled after the &acro.bib1; attribute set, and the non-use attributes type 2-6 are hard-wired in. It is therefore essential - to be familiar with . + to be familiar with . - +
- +
Boolean operators @@ -242,7 +242,7 @@ using the standard boolean operators into new query trees. Thus, boolean operators are always internal nodes in the query tree. - + Boolean operators @@ -268,24 +268,24 @@ @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 + 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.
- + - For example, we can combine the terms - information and retrieval + For example, we can combine the terms + information and retrieval into different searches in the default index of the default attribute set as follows. Querying for the union of all documents containing the terms information OR - retrieval: + retrieval: Z> find @or information retrieval @@ -293,7 +293,7 @@ Querying for the intersection of all documents containing the terms information AND - retrieval: + retrieval: The hit set is a subset of the corresponding OR query. @@ -305,7 +305,7 @@ terms information AND retrieval, taking proximity into account: The hit set is a subset of the corresponding - AND query + AND query (see the &acro.pqf; grammar for details on the proximity operator): @@ -316,7 +316,7 @@ 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. + other as described in the term list. The hit set is a subset of the corresponding PROXIMITY query. @@ -324,24 +324,24 @@
- - + +
Atomic queries (&acro.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 + quoted term list, and are often called Attributes-Plus-Terms (&acro.apt;) queries. - Atomic (&acro.apt;) queries are always leaf nodes in the &acro.pqf; query tree. + Atomic (&acro.apt;) queries are always leaf nodes in the &acro.pqf; query tree. 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. + See for details. - + Atomic queries (&acro.apt;) @@ -351,7 +351,7 @@ Type Notes - + attribute list @@ -363,7 +363,7 @@ term - single term + single term or quoted term list Here the search terms or list of search terms is added to the query @@ -395,15 +395,15 @@ - The scan operation is only supported with + The scan operation is only supported with atomic &acro.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 + the term debussy, and displaying this and the following terms in lexicographic order: @@ -411,8 +411,8 @@ - - + +
Named Result Sets @@ -421,7 +421,7 @@ result sets are leaf nodes in the &acro.pqf; query tree, exactly as atomic &acro.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 @@ -430,12 +430,12 @@ send a diagnostic to the effect that the requested result set does not exist any more. - + Defining a named result set and re-using it in the next query, using yaz-client. Notice that the client, not the server, assigns the string '1' to the - named result set. + named result set. Z> f @attr 1=4 mozart ... @@ -446,7 +446,7 @@ Number of hits: 14, setno 2 - + Named result sets are only supported by the &acro.z3950; protocol. @@ -456,19 +456,19 @@
- +
&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 + 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 @@ -490,7 +490,7 @@ It is possible to search in any silly string index - if it's defined in your - indexing rules and can be parsed by the &acro.pqf; parser. + indexing rules and can be parsed by the &acro.pqf; parser. This is definitely not the recommended use of this facility, as it might confuse your users with some very unexpected results. @@ -499,57 +499,57 @@ - See also for details, and + See also for details, and for the &acro.sru; &acro.pqf; query extension using string names as a fast debugging facility.
- +
- &zebra;'s special access point of type 'XPath' + <title>&zebra;'s special access point of type 'XPath' for &acro.grs1; filters As we have seen above, it is possible (albeit seldom a great - idea) to emulate + idea) to emulate XPath 1.0 based search by defining use (type 1) - string attributes which in appearance + 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 indexing 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 &acro.xml; element - than it pretends to access. + than it pretends to access. When using the &acro.grs1; Record Model (see ), we have the - possibility to embed life + possibility to embed life XPath expressions in the &acro.pqf; queries, which are here called use (type 1) xpath - attributes. You must enable the - xpath enable directive in your - .abs configuration files. + attributes. You must enable the + xpath enable directive in your + .abs configuration files. - Only a very restricted subset of the - XPath 1.0 + Only a very restricted subset of the + XPath 1.0 standard is supported as the &acro.grs1; record model is simpler than - a full &acro.xml; &acro.dom; structure. See the following examples for + a full &acro.xml; &acro.dom; structure. See the following examples for possibilities. - Finding all documents which have the term "content" + Finding all documents which have the term "content" inside a text node found in a specific &acro.xml; &acro.dom; - subtree, whose starting element is - addressed by XPath. + subtree, whose starting element is + addressed by XPath. - Z> find @attr 1=/root content + Z> find @attr 1=/root content Z> find @attr 1=/root/first content Notice that the @@ -560,19 +560,19 @@ It follows that the above searches are interpreted as: - Z> find @attr 1=/root//text() content + Z> find @attr 1=/root//text() content Z> find @attr 1=/root/first//text() content - + Searching inside attribute strings is possible: - Z> find @attr 1=/link/@creator morten + Z> find @attr 1=/link/@creator morten - + - + Filter the addressing XPath by a predicate working on exact string values in attributes (in the &acro.xml; sense) can be done: return all those docs which @@ -583,17 +583,17 @@ 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 + Z> find @attr 1=/link[@creator='sisse']/description[@xml:lang='da'] sibelius - - - Combining numeric indexes, boolean expressions, + + + Combining numeric indexes, boolean expressions, and xpath based searches is possible: Z> find @attr 1=/record/title @and foo bar Z> find @and @attr 1=/record/title foo @attr 1=4 bar - + Escaping &acro.pqf; keywords and other non-parseable XPath constructs @@ -615,39 +615,39 @@
- +
Explain Attribute Set - The &acro.z3950; standard defines the + The &acro.z3950; 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. + is populated with system internal information. - - The attribute-set exp-1 consists of a single - use attribute (type 1). + + The attribute-set exp-1 consists of a single + use attribute (type 1). In addition, the non-Use - &acro.bib1; attributes, that is, the types + &acro.bib1; attributes, that is, the types Relation, Position, - Structure, Truncation, - and Completeness are imported from + Structure, Truncation, + and Completeness are imported from the &acro.bib1; attribute set, and may be used - within any explain query. + within any explain query. - +
- Use Attributes (type = 1) + Use Attributes (type = 1) The following Explain search attributes are supported: - ExplainCategory (@attr 1=1), - DatabaseName (@attr 1=3), - DateAdded (@attr 1=9), + ExplainCategory (@attr 1=1), + DatabaseName (@attr 1=3), + DateAdded (@attr 1=9), DateChanged(@attr 1=10). @@ -657,12 +657,12 @@ DatabaseInfo, AttributeDetails. - See tab/explain.att and the + See tab/explain.att and the &acro.z3950; standard for more information.
- +
Explain searches with yaz-client @@ -670,13 +670,13 @@ via ASN.1. Practically no &acro.z3950; clients supports this. Fortunately they don't have to - &zebra; allows retrieval of this information in other formats: - &acro.sutrs;, &acro.xml;, + &acro.sutrs;, &acro.xml;, &acro.grs1; and ASN.1 Explain. - + List supported categories to find out which explain commands are - supported: + supported: Z> base IR-Explain-1 Z> find @attr exp1 1=1 categorylist @@ -684,7 +684,7 @@ Z> show 1+2 - + Get target info, that is, investigate which databases exist at this server endpoint: @@ -699,7 +699,7 @@ Z> show 1+1 - + List all supported databases, the number of hits is the number of databases found, which most commonly are the @@ -713,7 +713,7 @@ Z> show 1+2 - + Get database info record for database Default. @@ -726,7 +726,7 @@ Z> find @attrset exp1 @and @attr 1=1 databaseinfo @attr 1=3 Default - + Get attribute details record for database Default. @@ -745,38 +745,38 @@
- +
- +
&acro.bib1; Attribute Set Most of the information contained in this section is an excerpt of the ATTRIBUTE SET &acro.bib1; (&acro.z3950;-1995) SEMANTICS found at . The &acro.bib1; - Attribute Set Semantics from 1995, also in an updated + Attribute Set Semantics from 1995, also in an updated &acro.bib1; - Attribute Set + 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) - - A use attribute specifies an access point for any atomic query. - 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, - tab/dan1.att, - tab/explain.att, and - tab/gils.att. + + A use attribute specifies an access point for any atomic query. + 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, + tab/dan1.att, + tab/explain.att, and + tab/gils.att. - + For example, some few &acro.bib1; use attributes from the tab/bib1.att are: @@ -797,44 +797,44 @@ 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. + + New attribute sets can be added by adding new + tab/*.att configuration files, which need to + be sourced in the main configuration zebra.cfg. + + + In addition, &zebra; allows the access of + internal index names and dynamic + XPath as use attributes; see + and + . - - In addition, &zebra; allows the access of - internal index names and dynamic - XPath as use attributes; see - and - . - - - Phrase search for information retrieval in - the title-register, scanning the same register afterwards: - - Z> find @attr 1=4 "information retrieval" - Z> scan @attr 1=4 information - - + + Phrase search for information retrieval in + the title-register, scanning the same register afterwards: + + Z> find @attr 1=4 "information retrieval" + 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) - + Relation attributes describe the relationship of the access - point (left side + point (left side of the relation) to the search term as qualified by the attributes (right side of the relation), e.g., Date-publication <= 1975. - +
Relation Attributes (type 2) @@ -905,15 +905,15 @@ AlwaysMatches searches are only supported if alwaysmatches indexing has been enabled. See - - + + The relation attributes 1-5 are supported and work exactly as expected. - All ordering operations are based on a lexicographical ordering, - except when the + All ordering operations are based on a lexicographical ordering, + except when the structure attribute numeric (109) is used. In - this case, ordering is numerical. See + this case, ordering is numerical. See . Z> find @attr 1=Title @attr 2=1 music @@ -939,11 +939,11 @@ - The relation attribute + The relation attribute Relevance (102) is supported, see for full information. - + Ranked search for information retrieval in the title-register: @@ -953,16 +953,16 @@ - The relation attribute + The relation attribute AlwaysMatches (103) is in the default configuration - supported in conjecture with structure attribute + supported in conjecture with structure attribute Phrase (1) (which may be omitted by - default). + default). It can be configured to work with other structure attributes, - see the configuration file - tab/default.idx and - . + see the configuration file + tab/default.idx and + . AlwaysMatches (103) is a @@ -980,7 +980,7 @@
Position Attributes (type 3) - + The position attribute specifies the location of the search term within the field or subfield in which it appears. @@ -1031,16 +1031,16 @@
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 - at index time. + at index time. - - The possible values of the + + The possible values of the structure attribute (type 4) can be defined using the configuration file tab/default.idx. The default configuration is summarized in this table. @@ -1140,73 +1140,73 @@
- - 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 &acro.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 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 &acro.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 + 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, - 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 - - + + 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 + + - - In - the GILS schema (gils.abs), the - west-bounding-coordinate is indexed as type n, - and is therefore searched by specifying - structure=Numeric String. - To match all those records with west-bounding-coordinate greater - than -114 we use the following query: - - Z> find @attr 4=109 @attr 2=5 @attr gils 1=2038 -114 - + + In + the GILS schema (gils.abs), the + west-bounding-coordinate is indexed as type n, + and is therefore searched by specifying + structure=Numeric String. + To match all those records with west-bounding-coordinate greater + than -114 we use the following query: + + Z> find @attr 4=109 @attr 2=5 @attr gils 1=2038 -114 + The exact mapping between &acro.pqf; queries and &zebra; internal indexes - and index types is explained in + and index types is explained in .
- +
Truncation Attributes (type = 5) @@ -1289,10 +1289,10 @@ ... Number of hits: 95, setno 8 - + - The truncation attribute value + The truncation attribute value Process # in search term (101) is a poor-man's regular expression search. It maps each # to .*, and @@ -1305,10 +1305,10 @@ Number of hits: 89, setno 10 - + - The truncation attribute value - Regexp-1 (102) is a normal regular search, + The truncation attribute value + Regexp-1 (102) is a normal regular search, see for details. Z> find @attr 1=Body-of-text @attr 5=102 schnit+ke @@ -1317,13 +1317,13 @@ - The truncation attribute value + 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 position. + change of position. Z> find @attr 1=Body-of-text @attr 5=100 schnittke ... @@ -1334,21 +1334,21 @@ Number of hits: 103, setno 15 ... - +
- +
- Completeness Attributes (type = 6) + 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 + 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) @@ -1384,13 +1384,13 @@ 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 + not of structure type="w" or type="p". - + Incomplete subfield (1) is the default, and - makes &zebra; use - register type="w", whereas + makes &zebra; use + register type="w", whereas Complete field (3) triggers search and scan in index type="p". @@ -1404,7 +1404,7 @@ The exact mapping between &acro.pqf; queries and &zebra; internal indexes - and index types is explained in + and index types is explained in . @@ -1412,7 +1412,7 @@ - +
Extended &zebra; &acro.rpn; Features @@ -1423,20 +1423,20 @@ and non-portable: most functional extensions are modeled over the bib-1 attribute set, defining type 7 and higher values. - There are also the special + There are also the special string type index names for the - idxpath attribute set. + 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 + 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. @@ -1467,16 +1467,16 @@ &zebra; specific Search Extensions to all Attribute Sets &zebra; extends the &acro.bib1; attribute types, and these extensions are - recognized regardless of attribute + recognized regardless of attribute set used in a search operation query. - +
&zebra; Search Attribute Extensions - Name + Name Value Operation &zebra; version @@ -1537,38 +1537,38 @@ -
- + +
&zebra; Extension Embedded Sort Attribute (type 7) The embedded sort is a way to specify sort within a query - thus removing the need to send a Sort Request separately. It is both faster and does not require clients to deal with the Sort - Facility. + Facility. - + - All ordering operations are based on a lexicographical ordering, - except when the + All ordering operations are based on a lexicographical ordering, + except when the structure attribute numeric (109) is used. In - this case, ordering is numerical. See + this case, ordering is numerical. See . - + The possible values after attribute type 7 are - 1 ascending and - 2 descending. + 1 ascending and + 2 descending. The attributes+term (&acro.apt;) node is separate from the - rest and must be @or'ed. + rest and must be @or'ed. The term associated with &acro.apt; is the sorting level in integers, - where 0 means primary sort, + where 0 means primary sort, 1 means secondary sort, and so forth. See also . - For example, searching for water, sort by title (ascending) + For example, searching for water, sort by title (ascending) Z> find @or @attr 1=1016 water @attr 7=1 @attr 1=4 0 @@ -1581,40 +1581,40 @@
- - @@ -1622,13 +1622,13 @@ &zebra; Extension Rank Weight Attribute (type 9) Rank weight is a way to pass a value to a ranking algorithm - so - that one &acro.apt; has one value - while another as a different one. + that one &acro.apt; has one value - while another as a different one. See also . For example, searching for utah in title with weight 30 as well - as any with weight 20: - + as any with weight 20: + Z> find @attr 2=102 @or @attr 9=30 @attr 1=4 utah @attr 9=20 utah @@ -1637,23 +1637,23 @@
&zebra; Extension Term Reference Attribute (type 10) - &zebra; supports the searchResult-1 facility. + &zebra; supports the searchResult-1 facility. If the Term Reference Attribute (type 10) is given, that specifies a subqueryId value returned as part of the search result. It is a way for a client to name an &acro.apt; part of a - query. + query. Experimental. Do not use in production code. - + - +
- - - + + +
Local Approximative Limit Attribute (type 11) @@ -1676,7 +1676,7 @@ For example, we might be interested in exact hit count for a, but - for b we allow hit count estimates for 1000 and higher. + for b we allow hit count estimates for 1000 and higher. Z> find @and a @attr 11=1000 b @@ -1686,7 +1686,7 @@ 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. + exactness of hit counts against speed of execution. @@ -1694,7 +1694,7 @@ 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. + been processed.
@@ -1704,7 +1704,7 @@ 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 + hit counts instead. It has the same semantics as estimatehits for the . @@ -1717,7 +1717,7 @@ 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. + been processed.
@@ -1728,7 +1728,7 @@ &zebra; specific Scan Extensions to all Attribute Sets &zebra; extends the Bib1 attribute types, and these extensions are - recognized regardless of attribute + recognized regardless of attribute set used in a scan operation query. @@ -1757,44 +1757,44 @@ -
- + +
&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. + result set. Each hit count in scan is + @and'ed with the result set given. - Consider for example + 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: + restrict the scan to the result set of the query: - Z> scan @attr 1=4 mozart - ... - * mozart (43) - mozartforskningen (1) - mozartiana (1) - mozarts (16) - ... - Z> f @attr 1=4 amadeus - ... - Number of hits: 15, setno 2 - ... - Z> scan @attr 1=4 @attr 8=2 mozart - ... - * mozart (14) - mozartforskningen (0) - mozartiana (0) - mozarts (1) - ... + Z> scan @attr 1=4 mozart + ... + * mozart (43) + mozartforskningen (1) + mozartiana (1) + mozarts (16) + ... + Z> f @attr 1=4 amadeus + ... + Number of hits: 15, setno 2 + ... + Z> scan @attr 1=4 @attr 8=2 mozart + ... + * mozart (14) + mozartforskningen (0) + mozartiana (0) + mozarts (1) + ... - + &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. @@ -1808,16 +1808,16 @@ The &zebra; Extension Approximative Limit (type 12) is a way to enable approximate hit counts for scan hit counts, in the same - way as for search hit counts. + way as for search hit counts.
- +
&zebra; special &acro.idxpath; Attribute Set for &acro.grs1; indexing - The attribute-set idxpath consists of a single - Use (type 1) attribute. All non-use attributes behave as normal. + The attribute-set idxpath consists of a single + Use (type 1) attribute. All non-use attributes behave as normal. This feature is enabled when defining the @@ -1836,10 +1836,10 @@
- &acro.idxpath; Use Attributes (type = 1) + &acro.idxpath; Use Attributes (type = 1) This attribute set allows one to search &acro.grs1; filter indexed - records by &acro.xpath; like structured index names. + records by &acro.xpath; like structured index names. @@ -1848,7 +1848,7 @@ index names, which might clash with your own index names. - + &zebra; specific &acro.idxpath; Use Attributes (type 1) @@ -1899,22 +1899,22 @@ See tab/idxpath.att for more information. - Search for all documents starting with root element + Search for all documents starting with root element /root (either using the numeric or the string use attributes): - Z> find @attrset idxpath @attr 1=1 @attr 4=3 root/ - Z> find @attr idxpath 1=1 @attr 4=3 root/ - Z> find @attr 1=_XPATH_BEGIN @attr 4=3 root/ + Z> find @attrset idxpath @attr 1=1 @attr 4=3 root/ + Z> find @attr idxpath 1=1 @attr 4=3 root/ + Z> find @attr 1=_XPATH_BEGIN @attr 4=3 root/ - Search for all documents where specific nested &acro.xpath; + Search for all documents where specific nested &acro.xpath; /c1/c2/../cn exists. Notice the very counter-intuitive reverse notation! - Z> find @attrset idxpath @attr 1=1 @attr 4=3 cn/cn-1/../c1/ - Z> find @attr 1=_XPATH_BEGIN @attr 4=3 cn/cn-1/../c1/ + Z> find @attrset idxpath @attr 1=1 @attr 4=3 cn/cn-1/../c1/ + Z> find @attr 1=_XPATH_BEGIN @attr 4=3 cn/cn-1/../c1/ @@ -1925,19 +1925,19 @@ - Search for CDATA string anothertext in any - attribute: - + Search for CDATA string anothertext in any + attribute: + Z> find @attrset idxpath @attr 1=1015 anothertext Z> find @attr 1=_XPATH_ATTR_CDATA anothertext - Search for all documents with have an &acro.xml; element node - including an &acro.xml; attribute named creator - - Z> find @attrset idxpath @attr 1=3 @attr 4=3 creator - Z> find @attr 1=_XPATH_ATTR_NAME @attr 4=3 creator + Search for all documents with have an &acro.xml; element node + including an &acro.xml; attribute named creator + + Z> find @attrset idxpath @attr 1=3 @attr 4=3 creator + Z> find @attr 1=_XPATH_ATTR_NAME @attr 4=3 creator @@ -1951,7 +1951,7 @@ Scanning is supported on all idxpath indexes, both specified as numeric use attributes, or as string - index names. + index names. Z> scan @attrset idxpath @attr 1=1016 text Z> scan @attr 1=_XPATH_ATTR_CDATA anothertext @@ -1964,7 +1964,7 @@
- Mapping from &acro.pqf; atomic &acro.apt; queries to &zebra; internal + <title>Mapping from &acro.pqf; atomic &acro.apt; queries to &zebra; internal register indexes The rules for &acro.pqf; &acro.apt; mapping are rather tricky to grasp in the @@ -1972,19 +1972,19 @@ 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. + the named register. -
- Mapping of &acro.pqf; &acro.apt; access points - +
+ Mapping of &acro.pqf; &acro.apt; access points + &zebra; understands four fundamental different types of access - points, of which only the + points, of which only the numeric use attribute type access points are defined by the &acro.z3950; standard. All other access point types are &zebra; specific, and non-portable. - +
Access point name mapping @@ -1996,86 +1996,86 @@ GrammarNotes - - - - 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 - - - &acro.xpath; special index - XPath - /.* - special xpath search for &acro.grs1; indexed records - + + + + 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 + + + &acro.xpath; special index + XPath + /.* + special xpath search for &acro.grs1; indexed records +
- + - Attribute set names and + 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 + Numeric use attributes are mapped to the &zebra; internal string index according to the attribute set definition in use. The default attribute set is &acro.bib1;, and may be omitted in the &acro.pqf; query. - + According to normalization and numeric use attribute mapping, it follows that the following &acro.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 bib1 @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 - - + 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 bib1 @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) + 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 + If no use attribute is provided, a default of &acro.bib1; Use Any (1016) is assumed. The predefined use attribute sets can be reconfigured by tweaking the configuration files - tab/*.att, and + tab/*.att, and new attribute sets can be defined by adding similar files in the - configuration path profilePath of the server. - + configuration path profilePath of the server. + String indexes can be accessed directly, @@ -2091,10 +2091,10 @@ &zebra; internal indexes can be accessed directly, according to the same rules as the user defined - string indexes. The only difference is that + string indexes. The only difference is that &zebra; internal index names are hardwired, all uppercase and - must start with the character '_'. + must start with the character '_'. @@ -2102,7 +2102,7 @@ available using the &acro.grs1; 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 &acro.xpath; engine. See . @@ -2111,15 +2111,15 @@
-
- Mapping of &acro.pqf; &acro.apt; structure and completeness to + <section id="querymodel-pqf-apt-mapping-structuretype"> + <title>Mapping of &acro.pqf; &acro.apt; structure and completeness to register type - + Internally &zebra; has in its default configuration several - different types of registers or indexes, whose tokenization and - character normalization rules differ. This reflects the fact that + 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. + bitfields and string based text needs different rule sets. @@ -2136,7 +2136,7 @@ - phrase (@attr 4=1), word (@attr 4=2), + 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) @@ -2146,7 +2146,7 @@ - phrase (@attr 4=1), word (@attr 4=2), + 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) @@ -2196,59 +2196,59 @@ overruled overruled special - Internal record ID register, used whenever + Internal 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 - Completeness attribute of - Complete (Sub)field, the term is matched - 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 - &acro.grs1; *.abs file that contains a - p-specifier. + + + If a Structure attribute of + Phrase is used in conjunction with a + Completeness attribute of + Complete (Sub)field, the term is matched + 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 + &acro.grs1; *.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) benny carter (1) ... - Z> find @attr 1=Title @attr 4=1 @attr 6=3 "beethoven bibliography" + 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" + Z> find @attr 1=Title @attr 4=1 @attr 6=3 "beethoven bibliography database" ... Number of hits: 1, setno 6 - - + + - - If Structure=Phrase is - used in conjunction with Incomplete Field - the - default value for Completeness, the - search is directed against the normal word registers, but if the term - 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 &acro.grs1; *.abs file. + + If Structure=Phrase is + used in conjunction with Incomplete Field - the + default value for Completeness, the + search is directed against the normal word registers, but if the term + 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 &acro.grs1; *.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) + beefheart (1) * beethoven (18) - beethovens (7) + beethovens (7) ... - Z> find @attr 1=Title @attr 4=1 @attr 6=1 beethoven + Z> find @attr 1=Title @attr 4=1 @attr 6=1 beethoven ... Number of hits: 18, setno 1 ... @@ -2256,74 +2256,74 @@ ... Number of hits: 2, setno 2 ... - - + + - - If the Structure attribute is - Word List, - Free-form Text, or - Document Text, the term is treated as a - natural-language, relevance-ranked query. - This search type uses the word register, i.e. those fields - that are indexed as type w in the - &acro.grs1; *.abs file. - + + If the Structure attribute is + Word List, + Free-form Text, or + Document Text, the term is treated as a + natural-language, relevance-ranked query. + This search type uses the word register, i.e. those fields + that are indexed as type w in the + &acro.grs1; *.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 &acro.grs1; + + 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 &acro.grs1; *.abs file. - + - - If the Structure attribute is - 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. - + + If the Structure attribute is + 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. + - - If the Structure attribute is - Local Number the term is treated as - native &zebra; Record Identifier. - + + If the Structure attribute is + Local Number the term is treated as + native &zebra; Record Identifier. + - - If the Relation attribute is - Equals (default), the term is matched - in a normal fashion (modulo truncation and processing of - individual words, if required). - If Relation is Less Than, - Less Than or Equal, - Greater than, or Greater than or - Equal, the term is assumed to be numerical, and a - standard regular expression is constructed to match the given - expression. - If Relation is Relevance, - the standard natural-language query processor is invoked. - + + If the Relation attribute is + Equals (default), the term is matched + in a normal fashion (modulo truncation and processing of + individual words, if required). + If Relation is Less Than, + Less Than or Equal, + Greater than, or Greater than or + Equal, the term is assumed to be numerical, and a + standard regular expression is constructed to match the given + expression. + If Relation is Relevance, + the standard natural-language query processor is invoked. + - - For the Truncation attribute, - No Truncation is the default. - Left Truncation is not supported. - Process # in search term is supported, as is - Regxp-1. - Regxp-2 enables the fault-tolerant (fuzzy) - search. As a default, a single error (deletion, insertion, - replacement) is accepted when terms are matched against the register - contents. - + + For the Truncation attribute, + No Truncation is the default. + Left Truncation is not supported. + Process # in search term is supported, as is + Regxp-1. + Regxp-2 enables the fault-tolerant (fuzzy) + search. As a default, a single error (deletion, insertion, + replacement) is accepted when terms are matched against the register + contents. + -
+
&zebra; Regular Expressions in Truncation Attribute (type = 5) - + Each term in a query is interpreted as a regular expression if the truncation value is either Regxp-1 (@attr 5=102) @@ -2350,29 +2350,29 @@ - + The above operands can be combined with the following operators: - + Regular Expression Operators x* - Matches x zero or more times. + Matches x zero or more times. Priority: high. x+ - Matches x one or more times. + Matches x one or more times. Priority: high. x? - Matches x zero or once. + Matches x zero or once. Priority: high. @@ -2390,16 +2390,16 @@ 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, - which consists one digit. + which consists one digit. @@ -2427,19 +2427,19 @@
- + @@ -2449,66 +2449,66 @@ Using the <cql2rpn>l2rpn.txt</cql2rpn> - &yaz; Frontend Virtual + &yaz; Frontend Virtual Hosts option, one can configure the &yaz; Frontend &acro.cql;-to-&acro.pqf; - converter, specifying the interpretation of various + converter, specifying the interpretation of various &acro.cql; indexes, relations, etc. in terms of Type-1 query attributes. - + For example, using server-side &acro.cql;-to-&acro.pqf; conversion, one might query a zebra server like this: - querytype cql Z> find text=(plant and soil) ]]> - and - if properly configured - even static relevance ranking can - be performed using &acro.cql; query syntax: + and - if properly configured - even static relevance ranking can + be performed using &acro.cql; query syntax: - find text = /relevant (plant and soil) ]]> - + - By the way, the same configuration can be used to + By the way, the same configuration can be used to search using client-side &acro.cql;-to-&acro.pqf; conversion: - (the only difference is querytype cql2rpn - instead of + (the only difference is querytype cql2rpn + instead of querytype cql, and the call specifying a local conversion file) - querytype cql2rpn Z> find text=(plant and soil) ]]> - + Exhaustive information can be found in the Section &acro.cql; to &acro.rpn; conversion in the &yaz; manual. - - - + -
+