Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

yaz_hits(3) [php man page]

YAZ_HITS(3)								 1							       YAZ_HITS(3)

yaz_hits - Returns number of hits for last search

SYNOPSIS
int yaz_hits (resource $id, [array &$searchresult]) DESCRIPTION
yaz_hits(3) returns the number of hits for the last search. PARAMETERS
o $id - The connection resource returned by yaz_connect(3). o $searchresult - Result array for detailed search result information. RETURN VALUES
Returns the number of hits for the last search or 0 if no search was performed. The search result array (if supplied) holds information that is returned by a Z39.50 server in the SearchResult-1 format part of a search response. The SearchResult-1 format can be used to obtain information about hit counts for various parts of the query (subquery). In par- ticular, it is possible to obtain hit counts for the individual search terms in a query. Information for first subquery is in $array[0], second subquery in $array[1], and so forth. searchresult members +--------------------+---------------------------------------+ | Element | | | | | | | Description | | | | +--------------------+---------------------------------------+ | | | | id | | | | | | | Sub query ID2 (string) | | | | | | | | count | | | | | | | Result count / hits (integer) | | | | | | | | subquery.term | | | | | | | Sub query term (string) | | | | | | | |interpretation.term | | | | | | | Interpretated sub query term (string) | | | | | | | |recommendation.term | | | | | | | Recommended sub query term (string) | | | | +--------------------+---------------------------------------+ Note The SearchResult facility requires PECL YAZ 1.0.5 or later and YAZ 2.1.9 or later. Note Very few Z39.50 implementations support the SearchResult facility. PHP Documentation Group YAZ_HITS(3)

Check Out this Related Man Page

YAZ_SCAN(3)								 1							       YAZ_SCAN(3)

yaz_scan - Prepares for a scan

SYNOPSIS
void yaz_scan (resource $id, string $type, string $startterm, [array $flags]) DESCRIPTION
This function prepares for a Z39.50 Scan Request on the specified connection. To actually transfer the Scan Request to the server and receive the Scan Response, yaz_wait(3) must be called. Upon completion of yaz_wait(3) call yaz_error(3) and yaz_scan_result(3) to handle the response. PARAMETERS
o $id - The connection resource returned by yaz_connect(3). o $type - Currently only type rpn is supported. o $startterm - Starting term point for the scan. The form in which the starting term is specified is given by parameter $type. The syntax this parameter is similar to the RPN query as described in yaz_search(3). It consists of zero or more @attr-operator specifica- tions, then followed by exactly one token. o $flags - This optional parameter specifies additional information to control the behaviour of the scan request. Three indexes are cur- rently read from the flags array: number (number of terms requested), position (preferred position of term) and stepSize (pre- ferred step size). RETURN VALUES
No value is returned. EXAMPLES
Example #1 PHP function that scans titles <?php function scan_titles($id, $startterm) { yaz_scan($id, "rpn", "@attr 1=4 " . $startterm); yaz_wait(); $errno = yaz_errno($id); if ($errno == 0) { $ar = yaz_scan_result($id, $options); echo 'Scan ok; '; foreach ($options as $key => $val) { echo "$key = $val &nbsp;"; } echo '<br /><table>'; while (list($key, list($k, $term, $tcount)) = each($ar)) { if (empty($k)) continue; echo "<tr><td>$term</td><td>$tcount</td></tr>"; } echo '</table>'; } else { echo "Scan failed. Error: " . yaz_error($id) . "<br />"; } } ?> PHP Documentation Group YAZ_SCAN(3)
Man Page