X-Git-Url: http://git.indexdata.com/?p=yaz-moved-to-github.git;a=blobdiff_plain;f=doc%2Fclient.xml;h=d874fe1d71288fce6fddcc699fcc422f26ad520d;hp=92b38608bb66bebdd3d47ffbfbc5d9e7206833bc;hb=d168db0590bc858a1bc9bd5a6ea66abbcd8f7d7d;hpb=df38683ebdd6534f3f7b3b3a45a7a63e74b2bb80 diff --git a/doc/client.xml b/doc/client.xml index 92b3860..d874fe1 100644 --- a/doc/client.xml +++ b/doc/client.xml @@ -1,9 +1,9 @@ - + The YAZ client Introduction - yaz-client is a line-mode Z39.50 client. It supports a fair amount - of the functionality of the Z39.50-1995 standard + yaz-client is a line-mode Z39.50/SRU client. It supports a fair amount + of the functionality of the Z39.50v3 standard. 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. @@ -16,15 +16,27 @@ It can be started by typing - - yaz-client [options] [zurl] - + + yaz-client + -m fname + -a fname + -c fname + -q fname + -v level + -p target + -u auth + -k size + 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. + specifies a Z39.50/SRU host and, if specified, the client first tries to + establish connection with the Z39.50/SRU target. + + + Options are prefixed by - followed by a + particular letter. The following options are supported: @@ -57,6 +69,15 @@ + -q fname + + Sets the filename for CQL fields to + fname. If this option is not given the + YAZ client reads CQL fields from file + /usr/local/share/yaz/etc/pqf.properties. + + + -v level Sets the LOG level to level. @@ -66,6 +87,7 @@ debug, warn, log, + malloc, all, none. @@ -80,7 +102,7 @@ - -u authentication + -u auth Specifies authentication. Usually the form user/password @@ -90,10 +112,10 @@ - -k kilobytes + -k size Specifies the maximum messages size in kilobytes. - The default maximum messages for the YAZ client is 1024 + The default maximum message size for the YAZ client is 1024 (1 MB). @@ -102,18 +124,33 @@ 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 + database name marc, one could type + + yaz-client bagel.indexdata.dk:210/marc + + + + The same server is also a SRU service. Connect to it via HTTP + as follows: + + yaz-client http://bagel.indexdata.dk:210/marc + - - 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 + + + + The following command connects to a local server via UNIX + socket /tmp/yaz and sets maximum message size to + 5 MB. - yaz-client -a - localhost - + yaz-client -k 5120 unix:/tmp/yaz + + Commands @@ -127,401 +164,9 @@ The commands are (the letters in parenthesis are short names for the commands): - - - open zurl - - - Opens a connection to a server. The syntax for - zurl is the same as described - above for connecting from the command line. - - - Syntax: - - - [(tcp|ssl)':']host - [:port][/base>] - - - - - quit - - - Ends YAZ client - - - - f query - - Sends a 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, then the client - will fetch from position of the last retrieved record plus 1. If - number is not given, then 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. - A common convention for the authopen string - is that the username - and password is separated by a slash, e.g. - myusername/mysecret. - - - - - 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 corresponds 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 Update 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. - - - - - - . - filename - - - Executes list of commands from - file filename, just like source on - most UNIX shells. - - - - - - ! - args - - - Executes command args in subshell - using the system call. - - - - - - push_commande - command - - - The push_command takes another command as its argument. - That command is then added to the history information (so - you can retrieve it later). The command itself is not - executed. This command only works if you have GNU readline/history - enabled. - - - - - - set_apdufile - filename - - - Sets that APDU should be logged to file - filename. This command does the - thing as option -a. - - - - - set_marcdump - filename - - - Specifies that all retrieved records should be appended ot - file filename. This command does the - thing as option -m. - - - + &yaz-client-commands; - - set_cclfields - filename - - - Specifies that CCL fields should be read from file - file filename. This command does the - thing as option -c. - - - - - - register_oid - name - class - OID - - - This command allows you to register your own object - identifier - so that instead of entering a long dot-notation - you can use a short name instead. - The name is your - name for the OID, class is the - class, and OID is the raw OID in - dot notation. Class is one appctx, - absyn, attet, - transyn, diagset, - recsyn, resform, - accform, extserv, - userinfo, elemspec, - varset, schema, - tagset, general. - If you're in doubt use the general - class. - - - - - Searching