Delicious Bookmark this on Delicious Share on Facebook SlashdotSlashdot It! Digg! Digg



PHP : Function Reference : YAZ Functions : yaz_search

yaz_search

Prepares for a search (PHP 4 >= 4.0.1, PECL yaz:0.9-1.0.9)
bool yaz_search ( resource id, string type, string query )

Example 2679. Query Examples

You can search for simple terms, like this:

computer

which matches documents where "computer" occur. No attributes are specified.

The query

"knuth donald"

matches documents where "knuth donald" occur (provided that the server supports phrase search).

This query applies two attributes for the same phrase.

@attr 1=1003 @attr 4=1 "knuth donald"

First attribute is type 1 (Bib-1 use), attribute value is 1003 (Author). Second attribute has is type 4 (structure), value 1 (phrase), so this should match documents where Donald Knuth is author.

The query

@and @or a b @not @or c d e

would in infix notation look like (a or b) and ((c or d) not e).

Another, more complex, one:

@attrset gils @and @attr 1=4 art @attr 1=2000 company

The query as a whole uses the GILS attributeset. The query matches documents where art occur in the title (GILS,BIB-1) and in which company occur as Distributor (GILS).


Code Examples / Notes » yaz_search

sean

You can find the full Bib-1 attribute set at http://www.loc.gov/z3950/agency/defns/bib1.html

jwohlers

Quick Reference For Attribute Fields
(eg: "@attr 2=" refers to the Relation attribute)
1 = Use Field
2 = Relation
3 = Position
4 = Structure
5 = Truncate
6 = Completeness


Change Language


Follow Navioo On Twitter
yaz_addinfo
yaz_ccl_conf
yaz_ccl_parse
yaz_close
yaz_connect
yaz_database
yaz_element
yaz_errno
yaz_error
yaz_es_result
yaz_es
yaz_get_option
yaz_hits
yaz_itemorder
yaz_present
yaz_range
yaz_record
yaz_scan_result
yaz_scan
yaz_schema
yaz_search
yaz_set_option
yaz_sort
yaz_syntax
yaz_wait
eXTReMe Tracker