X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=doc%2Fclient.xml;fp=doc%2Fclient.xml;h=d7d60e6b3ac08fa19e711eb05493d55105073c99;hb=fe4182bf1ca7bebcb3172cde916d4467c2154e7b;hp=0000000000000000000000000000000000000000;hpb=b26c2480fcd2d6c93484372b1b748c5ac54f2c99;p=yaz-moved-to-github.git diff --git a/doc/client.xml b/doc/client.xml new file mode 100644 index 0000000..d7d60e6 --- /dev/null +++ b/doc/client.xml @@ -0,0 +1,444 @@ + + The YAZ client + Introduction + + yaz-client is a linemode Z39.50 client. It supports a fair amount + of the functionality of the Z39.50-1995 standard, but some things you + need to enable or disable by recompilation. + Its primary purpose is to exercise the + package, and verify that the protocol works OK. + For the same reason some commands offers more functionality than others. + Commands that exercies common Z39.50 services such as search and present + have more features than less common supported services, such as Extended + Services (ItemOrder, ItemUpdate,..). + + + Invoking the YAZ client + + It can be started by typing + + + yaz-client [options] [zurl] + + + in a UNIX shell / WIN32 console. The zurl, + specifies a Z39.50 host and, if specified, the client first tries to + establish connection with the Z39.50 target on the host. + Options are, as usual, are prefixed by - followed + by a particular letter. + + + The following options are supported: + + + + -m fname + + ISO2709 records are appended to file + fname. All records as returned by a target(s) + in Search Responses and Present Responses are appended verbatim to + the file. + + + + -a fname + + Pretty-print log of APDUs sent and received is appended + to the file fname. + If fname is - (minus) + the APDU log is written to stderr. + + + + -c fname + + Sets the filename for CCL fields to + fname. If this option is not given the + YAZ client reads CCL fields from file default.bib. + + + + -v level + + Sets the LOG level to level. + Level is a sequence of tokens separated by comman. Each token + is a integer or a named LOG item - one of + fatal, + debug, + warn, + log, + all, + none. + + + + + In order to connect to Index Data's test Z39.50 server on + bagel.indexdata.dk, port 210 and with the + database name marc, one would have to type + + + yaz-client bagel.indexdata.dk:210/marc + + + In order to enable APDU log and connect to localhost, port 210 (default) + and database Default (default) you'd write: + + + yaz-client -a - localhost + + + YAZ client commands + + When the YAZ client has read options and connected to a target, if given, + it will display Z > and away your command. + Commands are executed by hitting the return key. + You can always issue the command ? to see the list + of available commands. + + + The commands are (the letters in parenthesis are short + names for the commands): + + + + open zurl + + o + + Opens a connection to a server. The syntax for + zurl is the same as described + above for connecting from the command line. + + + Syntax: + + + [(tcp|osi)':'<[tsel/]]host[:port][/base>] + + + + + quit + + q + + Ends YAZ client + + + + f query + f + + Sends Search Request using the query + given. + + + + + delete setname + + Deletes result set with name setname + on the server. + + + + base base1 + base2 ... + + + Sets the name(s) of the database(s) to search. One or more + databases may be specified separated by blanks. This commands overrides + the database given in zurl. + + + + + show [start[+number]] + + s + + Fetches records by sending a Present Request from the start + position given by + start + a number of records given by number. If + start is not given the client will + fetch from position of the last retrieved record plus 1. If + number is not given one record will be + fetched at a time. + + + + + scan term + + + Scans + database index for a term. The syntax resembles the syntax + for find. + If you want to scan for the word water you could + write + + + scan water + + + but if you want to scan only in, say the title field, you would write + + + scan @attr 1=4 water + + + + + sort sortspecs + + + Sorts a result set. The sort command takes a sequence of + sort specifications. A sort + specification holds a field (sort criteria) and is followed by flags. + If the sort criteria includes = it is assumed + that the sort SortKey is of type sortAttributes using Bib-1. + The integer before = is + the attribute type and the integer following = + is the attribute value. + If no = is in the SortKey it is treated as a + sortfield-type of type InternationalString. + Flags observed are: s + for case sensitive, i for case insensitive, + < for sort ascending and > + for sort descending. + + + + + sort+ + + + Same as sort but stores the sorted + result set in a new result set. + + + + + authentication openauth + + + Sets up a authentication string if a server requires + authentication (v2 OpenStyle). The authentication string is first + sent to the server when the open command is + issued and the Z39.50 Initialize Request is sent, so this command + must be used before open in order to be effective. + + + + + lslb n + + + Sets the limit for when no records should be returned + together with the search result. + See the + + Z39.50 standard + + for more details. + + + + + + ssub n + + + Sets the limit for when all records should be returned with + the search result. + See the + + Z39.50 standard + for more details. + + + + + + mspn n + + + Sets the number of records should be returned if the + number of records in the result set is between the values of + lslb and ssub. + See the + + Z39.50 standard + + for more details. + + + + + status + + + Displays the values of lslb, + ssub and mspn. + + + + + setname + + + Switches named result sets on and off. Default is on. + + + + + cancel + + + Sends a Trigger Resource Control Request to the target. + + + + + format oid + + + Sets the preferred transfer syntax for retrieved records. + yaz-client supports all the record syntaxes that currently + are registered. See + + Z39.50 Standard + + for more details. Commonly used records syntaxes include usmarc, + sutrs, grs1 and xml. + + + + + elements e + + + Sets the element set name for the records. Many targets support + element sets are B (for brief) and F (for full). + + + + + close + + + Sends a Z39.50 Close APDU and closes connection with the peer + + + + + querytype type + + + Sets the query type as used by command find. + The following is supported: prefix for + Prefix Query Notation (Type-1 Query); + ccl for CCL search (Type-2 + Query) or ccl2rpn for + CCL to RPN conversion (Type-1 Query). + + + + + attributeset set + + + + Sets attribute set OID for prefix queries (RPN, Type-1). + + + + + refid id + + + Sets reference ID for Z39.50 Request(s). + + + + + itemorder + type no + + + Sends an Item Order Request using the ILL External. + type is either 1 or 2 which correponds to + ILL-Profile 1 and 2 respectively. The no + is the Result Set position of the record to be ordered. + + + + + update + + + Sends Item Update Request. This command sends a "minimal" + PDU to the target supplying the last received record from the target. + If no record has been received from the target this command is ignored + and nothing is sent to the target. + + + + + + Searching + + The simplest example of a Prefix Query would be something like + + f knuth + + or + + f "donald knuth" + + In those queries no attributes was specified. + This leaves it up to the server what fields to search but + most servers will search in all fields. Some servers does not + support this feature though, and require that some attributes + are defined. To add one attribute you could do: + + f @attr 1=4 computer + + where we search in the title field, since the use(1) is title(4). + If we want to search in the author field and + in the title field, and in the title field using right truncation + it could look something like this: + + f @and @attr 1=1003 knuth @attr 1=4 @attr 5=1 computer + + Finally using a mix of Bib-1 and GILS attributes could look + something like this: + + f @attrset Bib-1 @and @attr GILS 1=2008 Washington @attr 1=21 weather + + For the full specifiction of the Prefix Query see the section + Prefix Query Format. + + + + +