mirror of
https://github.com/sigmasternchen/php-doc-en
synced 2025-03-28 23:08:55 +00:00

git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@141299 c90b9560-bf6c-de11-be94-00142212c4b1
152 lines
5.4 KiB
XML
152 lines
5.4 KiB
XML
<?xml version="1.0" encoding="iso-8859-1"?>
|
|
<!-- $Revision: 1.5 $ -->
|
|
<!-- splitted from ./en/functions/yaz.xml, last change in rev 1.1 -->
|
|
<refentry id="function.yaz-search">
|
|
<refnamediv>
|
|
<refname>yaz_search</refname>
|
|
<refpurpose>Prepares for a search</refpurpose>
|
|
</refnamediv>
|
|
<refsect1>
|
|
<title>Description</title>
|
|
<methodsynopsis>
|
|
<type>int</type><methodname>yaz_search</methodname>
|
|
<methodparam><type>resource</type><parameter>id</parameter></methodparam>
|
|
<methodparam><type>string</type><parameter>type</parameter></methodparam>
|
|
<methodparam><type>string</type><parameter>query</parameter></methodparam>
|
|
</methodsynopsis>
|
|
<para>
|
|
<function>yaz_search</function> prepares for a search on the
|
|
connection given by parameter <parameter>id</parameter>.
|
|
The parameter <parameter>type</parameter> represents the query type - only
|
|
<literal>"rpn"</literal> is supported now in which case the
|
|
third argument specifies a Type-1 query in prefix query notation.
|
|
Like <function>yaz_connect</function> this
|
|
function is non-blocking and only prepares for a search to be
|
|
executed later when <function>yaz_wait</function> is called.
|
|
</para>
|
|
</refsect1>
|
|
<refsect1>
|
|
<title>The RPN query</title>
|
|
<para>
|
|
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 operater
|
|
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 (<literal>@</literal>) are considered operators,
|
|
otherwise they are treated as search terms.
|
|
</para>
|
|
<table>
|
|
<title>RPN Operators</title>
|
|
<tgroup cols="2">
|
|
<colspec colwidth="1*" colname="construct"/>
|
|
<colspec colwidth="2*" colname="description"/>
|
|
<thead>
|
|
<row>
|
|
<entry>Construct</entry>
|
|
<entry>Description</entry>
|
|
</row>
|
|
</thead>
|
|
<tbody>
|
|
<row>
|
|
<entry><literal>@and</literal> query1 query2</entry>
|
|
<entry>intersection of query1 and query2</entry>
|
|
</row>
|
|
<row>
|
|
<entry><literal>@or</literal> query1 query2</entry>
|
|
<entry>union of query1 and query2</entry>
|
|
</row>
|
|
<row>
|
|
<entry><literal>@not</literal> query1 query2</entry>
|
|
<entry>query1 and not query2</entry>
|
|
</row>
|
|
<row>
|
|
<entry><literal>@set</literal> name</entry>
|
|
<entry>result set reference</entry>
|
|
</row>
|
|
<row>
|
|
<entry><literal>@attrset</literal> set query</entry>
|
|
<entry>specifies attribute-set for query. This construction is only
|
|
allowed once - in the beginning of the whole query</entry>
|
|
</row>
|
|
<row>
|
|
<entry><literal>@attr</literal> [set] type=value query</entry>
|
|
<entry>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.</entry>
|
|
</row>
|
|
</tbody>
|
|
</tgroup>
|
|
</table>
|
|
<example>
|
|
<title>Query Examples</title>
|
|
<para>
|
|
You can search for simple terms, like this
|
|
<screen>computer</screen>
|
|
which matches documents where "computer" occur.
|
|
No attributes are specified.
|
|
</para>
|
|
<para>
|
|
The Query
|
|
<screen>"knuth donald"</screen>
|
|
matches documents where "knuth donald" occur (provided that the
|
|
server supports phrase search).
|
|
</para>
|
|
<para>
|
|
This query applies two attributes for the same phrase.
|
|
<screen>@attr 1=1003 @attr 4=1 "knuth donald"</screen>
|
|
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.
|
|
</para>
|
|
<para>
|
|
This query
|
|
<screen>@and @or a b @not @or c d e</screen>
|
|
would in infix notation look like
|
|
<literal>(a or b) and ((c or d) not e)</literal>.
|
|
</para>
|
|
<para>
|
|
Another, more complex, one:
|
|
<screen>@attrset gils @and @attr 1=4 art @attr 1=2000 company</screen>
|
|
The query as a whole uses the GILS attributeset. The query matches
|
|
documents where <literal>art</literal> occur in the title (GILS,BIB-1)
|
|
and in which <literal>company</literal> occur as Distributor (GILS).
|
|
</para>
|
|
</example>
|
|
<para>
|
|
You can find information about attributes at the
|
|
<ulink url="&url.yaz-loc-bib1;">Z39.50 Maintenance Agency</ulink>
|
|
site.
|
|
</para>
|
|
<note>
|
|
<para>
|
|
If you would like to use a more friendly notation,
|
|
use the CCL parser - functions <function>yaz_ccl_conf</function> and
|
|
<function>yaz_ccl_parse</function>.
|
|
</para>
|
|
</note>
|
|
</refsect1>
|
|
</refentry>
|
|
|
|
<!-- Keep this comment at the end of the file
|
|
Local variables:
|
|
mode: sgml
|
|
sgml-omittag:t
|
|
sgml-shorttag:t
|
|
sgml-minimize-attributes:nil
|
|
sgml-always-quote-attributes:t
|
|
sgml-indent-step:1
|
|
sgml-indent-data:t
|
|
indent-tabs-mode:nil
|
|
sgml-parent-document:nil
|
|
sgml-default-dtd-file:"../../../../manual.ced"
|
|
sgml-exposed-tags:nil
|
|
sgml-local-catalogs:nil
|
|
sgml-local-ecat-files:nil
|
|
End:
|
|
vim600: syn=xml fen fdm=syntax fdl=2 si
|
|
vim: et tw=78 syn=sgml
|
|
vi: ts=1 sw=1
|
|
-->
|