From 9728725bfe87ad1c09c9cd0302e96862a08763ea Mon Sep 17 00:00:00 2001 From: Adam Dickmeiss Date: Fri, 10 Aug 2001 13:00:35 +0000 Subject: [PATCH] Documentation for yaz_sort. New options for yaz_connect and yaz_wait. git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@54094 c90b9560-bf6c-de11-be94-00142212c4b1 --- functions/yaz.xml | 187 +++++++++++++++++++++++++++++++++++++++------- 1 file changed, 159 insertions(+), 28 deletions(-) diff --git a/functions/yaz.xml b/functions/yaz.xml index 576268bd97..eddaecaf4f 100644 --- a/functions/yaz.xml +++ b/functions/yaz.xml @@ -1,4 +1,4 @@ - + YAZ functions YAZ @@ -31,8 +31,8 @@ Installation Compile YAZ and install it. Build PHP with your favourite - modules and add option --with-yaz. Your task is roughly the - following: + modules and add option --with-yaz. + Your task is roughly the following: @@ -176,8 +176,8 @@ if (empty($term) || count($host) == 0) { string zurl - string - authentication + mixed + options @@ -194,6 +194,55 @@ if (empty($term) || count($host) == 0) { merely prepares a connect to be performed later when yaz_wait is called. + + If the second argument, options, is given as + a string it is treated as the Z39.50 V2 authentication string + (OpenAuth). + + + If options is given as an array the contents + of the array serves as options. Note that array options are only + supported for PHP 4.0.7 and later. + + + <function>yaz_connect</function> options + user + Username for authentication. + + + group + Group for authentication. + + + password + Password for authentication. + + + cookie + Cookie for session (YAZ proxy). + + + proxy + Proxy for connection (YAZ proxy). + + + persistent + A boolean. If &true; the connection is persistent; If +&false; the connection is not persistent. By default connections are +persistent. + + + piggyback + A boolean. If &true; piggyback is enabled for +searches; If &false; piggyback is disabled. +By default piggyback is enabled. Enabling piggyback is more efficient +and usually saves a network-round-trip for first time fetches of records. +However, a few Z39.50 targets doesn't support piggyback or they ignore +element set names. For those, piggyback should be disabled. + + + + @@ -471,35 +520,33 @@ if (empty($term) || count($host) == 0) { + + Query Examples - The following illustrates valid query constructions: - + Query computer - - Matches documents where "computer" occur. No attributes are specified. + matches documents where "computer" occur. No attributes are specified. - - + + The Query "donald knuth" - - Matches documents where "donald knuth" occur. - - - + matches documents where "donald knuth" occur. + + + For the query @attr 1=4 art - - Attribute type is 1 (Bib-1 use), attribute value is 4 - Title), so this should match documents where "art" occur - in the title. - - - + attribute type is 1 (Bib-1 use), attribute value is 4 + Title), so this should match documents where art + occur in the title. + + + Another more complex one: @attrset gils @and @attr 1=4 art @attr 1=1003 "donald knuth" - The query as a whole uses the GILS attributeset. The query matches - documents where "art" occur in the title and in which "donald knuth" - occur in the author. - + documents where art occur in the title and in which + donald knuth occur in the author. + + @@ -883,7 +930,9 @@ itemorder-item int yaz_wait - + + array options + @@ -895,6 +944,88 @@ itemorder-item yaz_wait returns when all targets have either completed all requests or aborted (in case of errors). + + If the options array is given that holds + options that change the behaviour of yaz_wait. + + + timeout + Sets timeout in seconds. If a target hasn't responded within + the timeout it is considered dead and yaz_wait + returns. The default value for timeout is 15 seconds. + + + + + + + + + yaz_sort + Sets sorting criteria + + + Description + + + int yaz_sort + int id + string criteria + + + + This function sets sorting criteria and enables Z39.50 Sort. + Use this function together with yaz_search + or yaz_present. Using this function alone + doesn't have any effect. If used in conjunction with + yaz_search a Z39.50 Sort will be sent after + a search response has been received and before any records are + retrieved with Z39.50 Present. The criteria + takes the form + + + field1 flags1 field2 flags2 ... + + + where field1 specifies primary attributes for sort, field2 seconds, + etc.. The field specifies either numerical attribute combinations consisting + of type=value pairs separated by comma (e.g. 1=4,2=1) + ; or the field may specify a plain string criteria + (e.g. title. The flags is a sequnce of the + following characters which may not be separated by any white space. + + + Sort Flags + a + Sort ascending + + d + Sort descending + + i + Case insensitive sorting + + s + Case sensitive sorting + + + + Sort Criterias + + To sort on Bib1 attribute title, case insensitive, + and ascending you'd use the following sort criteria: + + 1=4 ia + + + + If the secondary sorting criteria should be author, case sensitive + and ascending you'd use: + + 1=4 ia 1=1003 sa + + +