<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <HTML ><HEAD ><TITLE >yaz_hits</TITLE ><META NAME="GENERATOR" CONTENT="Modular DocBook HTML Stylesheet Version 1.79"><LINK REL="HOME" TITLE="PHP 手册" HREF="index.html"><LINK REL="UP" TITLE="YAZ Functions" HREF="ref.yaz.html"><LINK REL="PREVIOUS" TITLE="yaz_get_option" HREF="function.yaz-get-option.html"><LINK REL="NEXT" TITLE="yaz_itemorder" HREF="function.yaz-itemorder.html"><META HTTP-EQUIV="Content-type" CONTENT="text/html; charset=UTF-8"></HEAD ><BODY CLASS="refentry" BGCOLOR="#FFFFFF" TEXT="#000000" LINK="#0000FF" VLINK="#840084" ALINK="#0000FF" ><DIV CLASS="NAVHEADER" ><TABLE SUMMARY="Header navigation table" WIDTH="100%" BORDER="0" CELLPADDING="0" CELLSPACING="0" ><TR ><TH COLSPAN="3" ALIGN="center" >PHP 手册</TH ></TR ><TR ><TD WIDTH="10%" ALIGN="left" VALIGN="bottom" ><A HREF="function.yaz-get-option.html" ACCESSKEY="P" >上一页</A ></TD ><TD WIDTH="80%" ALIGN="center" VALIGN="bottom" ></TD ><TD WIDTH="10%" ALIGN="right" VALIGN="bottom" ><A HREF="function.yaz-itemorder.html" ACCESSKEY="N" >下一页</A ></TD ></TR ></TABLE ><HR ALIGN="LEFT" WIDTH="100%"></DIV ><H1 ><A NAME="function.yaz-hits" ></A >yaz_hits</H1 ><DIV CLASS="refnamediv" ><A NAME="AEN248018" ></A ><P > (PHP 4 >= 4.0.1, PECL)</P >yaz_hits -- Returns number of hits for last search</DIV ><DIV CLASS="refsect1" ><A NAME="AEN248021" ></A ><H2 >说明</H2 >int <B CLASS="methodname" >yaz_hits</B > ( resource id [, array searchresult] )<BR ></BR ><P > <B CLASS="function" >yaz_hits()</B > returns the number of hits for the last search. </P ></DIV ><DIV CLASS="refsect1" ><A NAME="AEN248034" ></A ><H2 >参数</H2 ><P > <P ></P ><DIV CLASS="variablelist" ><DL ><DT ><CODE CLASS="parameter" >id</CODE ></DT ><DD ><P > The connection resource returned by <A HREF="function.yaz-connect.html" ><B CLASS="function" >yaz_connect()</B ></A >. </P ></DD ><DT ><CODE CLASS="parameter" >searchresult</CODE ></DT ><DD ><P > Result array for detailed search result information. </P ></DD ></DL ></DIV > </P ></DIV ><DIV CLASS="refsect1" ><A NAME="AEN248049" ></A ><H2 >返回值</H2 ><P > Returns the number of hits for the last search or 0 if no search was performed. </P ><P > 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 particular, 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. </P ><DIV CLASS="table" ><A NAME="AEN248053" ></A ><P ><B >表 1. searchresult members</B ></P ><TABLE BORDER="1" CLASS="CALSTABLE" ><COL WIDTH="1*" TITLE="element"><COL WIDTH="2*" TITLE="description"><THEAD ><TR ><TH >Element</TH ><TH >Description</TH ></TR ></THEAD ><TBODY ><TR ><TD ><TT CLASS="literal" >id</TT ></TD ><TD >Sub query ID2 (string)</TD ></TR ><TR ><TD ><TT CLASS="literal" >count</TT ></TD ><TD >Result count / hits (integer)</TD ></TR ><TR ><TD ><TT CLASS="literal" >subquery.term</TT ></TD ><TD >Sub query term (string)</TD ></TR ><TR ><TD ><TT CLASS="literal" >interpretation.term</TT ></TD ><TD >Interpretated sub query term (string)</TD ></TR ><TR ><TD ><TT CLASS="literal" >recommendation.term</TT ></TD ><TD >Recommended sub query term (string)</TD ></TR ></TBODY ></TABLE ></DIV ><DIV CLASS="note" ><BLOCKQUOTE CLASS="note" ><P ><B >注意: </B > The SearchResult facility requires PECL YAZ 1.0.5 or later and YAZ 2.1.9 or later. </P ></BLOCKQUOTE ></DIV ><DIV CLASS="note" ><BLOCKQUOTE CLASS="note" ><P ><B >注意: </B > Very few Z39.50 implementations support the SearchResult facility. </P ></BLOCKQUOTE ></DIV ></DIV ><DIV CLASS="NAVFOOTER" ><HR ALIGN="LEFT" WIDTH="100%"><TABLE SUMMARY="Footer navigation table" WIDTH="100%" BORDER="0" CELLPADDING="0" CELLSPACING="0" ><TR ><TD WIDTH="33%" ALIGN="left" VALIGN="top" ><A HREF="function.yaz-get-option.html" ACCESSKEY="P" >上一页</A ></TD ><TD WIDTH="34%" ALIGN="center" VALIGN="top" ><A HREF="index.html" ACCESSKEY="H" >起始页</A ></TD ><TD WIDTH="33%" ALIGN="right" VALIGN="top" ><A HREF="function.yaz-itemorder.html" ACCESSKEY="N" >下一页</A ></TD ></TR ><TR ><TD WIDTH="33%" ALIGN="left" VALIGN="top" >yaz_get_option</TD ><TD WIDTH="34%" ALIGN="center" VALIGN="top" ><A HREF="ref.yaz.html" ACCESSKEY="U" >上一级</A ></TD ><TD WIDTH="33%" ALIGN="right" VALIGN="top" >yaz_itemorder</TD ></TR ></TABLE ></DIV ></BODY ></HTML >