yaz_search
(PHP 4 >= 4.0.1, PECL yaz >= 0.9.0)
yaz_search — Prepares for a search
Description
$id
, string $type
, string $query
) : boolyaz_search() prepares for a search on the given connection.
Like yaz_connect() this function is non-blocking and only prepares for a search to be executed later when yaz_wait() is called.
Parameters
-
id
-
The connection resource returned by yaz_connect().
-
type
-
This parameter represents the query type - only "rpn" is supported now in which case the third argument specifies a Type-1 query in prefix query notation.
-
query
-
The RPN query is a textual representation of the Type-1 query as defined by the Z39.50 standard. However, in the text representation as used by YAZ a prefix notation is used, that is the operator precedes the operands. The query string is a sequence of tokens where white space is ignored unless surrounded by double quotes. Tokens beginning with an at-character (@) are considered operators, otherwise they are treated as search terms.
RPN Operators Construct Description @and query1 query2 intersection of query1 and query2 @or query1 query2 union of query1 and query2 @not query1 query2 query1 and not query2 @set name result set reference @attrset set query specifies attribute-set for query. This construction is only allowed once - in the beginning of the whole query @attr [set] type=value query applies attribute to query. The type and value are integers specifying the attribute-type and attribute-value respectively. The set, if given, specifies the attribute-set. You can find information about attributes at the » Z39.50 Maintenance Agency site.
Note:
If you would like to use a more friendly notation, use the CCL parser - functions yaz_ccl_conf() and yaz_ccl_parse().
Examples
Example #1 Query Examples
You can search for simple terms, like this:
computer
The query
"knuth donald"
This query applies two attributes for the same phrase.
The query
@and @or a b @not @or c d e
Another, more complex, one:
@attrset gils @and @attr 1=4 art @attr 1=2000 company
English translation
You have asked to visit this site in English. For now, only the interface is translated, but not all the content yet.If you want to help me in translations, your contribution is welcome. All you need to do is register on the site, and send me a message asking me to add you to the group of translators, which will give you the opportunity to translate the pages you want. A link at the bottom of each translated page indicates that you are the translator, and has a link to your profile.
Thank you in advance.
Document created the 30/01/2003, last modified the 26/10/2018
Source of the printed document:https://www.gaudry.be/en/php-rf-yaz-search.html
The infobrol is a personal site whose content is my sole responsibility. The text is available under CreativeCommons license (BY-NC-SA). More info on the terms of use and the author.
References
These references and links indicate documents consulted during the writing of this page, or which may provide additional information, but the authors of these sources can not be held responsible for the content of this page.
The author This site is solely responsible for the way in which the various concepts, and the freedoms that are taken with the reference works, are presented here. Remember that you must cross multiple source information to reduce the risk of errors.