gluke Fri Feb 9 05:29:19 2001 EDT
Modified files:
/php4/ext/mnogosearch php_mnogo.c test.php
Log:
Added UDM_PARAM_FIRST_DOC and UDM_PARAM_LAST_DOC mnoGoSearch extenstion
result parameters. Example updated.
Index: php4/ext/mnogosearch/php_mnogo.c
diff -u php4/ext/mnogosearch/php_mnogo.c:1.12 php4/ext/mnogosearch/php_mnogo.c:1.13
--- php4/ext/mnogosearch/php_mnogo.c:1.12 Thu Feb 8 05:33:36 2001
+++ php4/ext/mnogosearch/php_mnogo.c Fri Feb 9 05:29:19 2001
@@ -1,5 +1,5 @@
/* $Source: /local/repository/php4/ext/mnogosearch/php_mnogo.c,v $ */
-/* $Id: php_mnogo.c,v 1.12 2001/02/08 13:33:36 gluke Exp $ */
+/* $Id: php_mnogo.c,v 1.13 2001/02/09 13:29:19 gluke Exp $ */
/*
+----------------------------------------------------------------------+
@@ -67,6 +67,8 @@
#define UDM_PARAM_FOUND 257
#define UDM_PARAM_WORDINFO 258
#define UDM_PARAM_SEARCHTIME 259
+#define UDM_PARAM_FIRST_DOC 260
+#define UDM_PARAM_LAST_DOC 261
/* True globals, no need for thread safety */
static int le_link,le_res;
@@ -167,6 +169,8 @@
REGISTER_LONG_CONSTANT("UDM_PARAM_WORD_INFO", UDM_PARAM_WORDINFO,CONST_CS |
CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("UDM_PARAM_SEARCHTIME", UDM_PARAM_SEARCHTIME,CONST_CS
| CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("UDM_PARAM_SEARCH_TIME", UDM_PARAM_SEARCHTIME,CONST_CS
| CONST_PERSISTENT);
+ REGISTER_LONG_CONSTANT("UDM_PARAM_FIRST_DOC", UDM_PARAM_FIRST_DOC,CONST_CS |
+CONST_PERSISTENT);
+ REGISTER_LONG_CONSTANT("UDM_PARAM_LAST_DOC", UDM_PARAM_LAST_DOC,CONST_CS |
+CONST_PERSISTENT);
/* search modes */
REGISTER_LONG_CONSTANT("UDM_MODE_ALL", UDM_MODE_ALL,CONST_CS |
CONST_PERSISTENT);
@@ -635,6 +639,14 @@
case UDM_PARAM_SEARCHTIME:
RETURN_DOUBLE(((double)Res->work_time)/1000);
break;
+
+ case UDM_PARAM_FIRST_DOC:
+ RETURN_LONG(Res->first);
+ break;
+
+ case UDM_PARAM_LAST_DOC:
+ RETURN_LONG(Res->last);
+ break;
default:
php_error(E_WARNING,"Udm_Get_Res_Param: Unknown mnoGoSearch
param name");
Index: php4/ext/mnogosearch/test.php
diff -u php4/ext/mnogosearch/test.php:1.9 php4/ext/mnogosearch/test.php:1.10
--- php4/ext/mnogosearch/test.php:1.9 Thu Feb 8 05:33:36 2001
+++ php4/ext/mnogosearch/test.php Fri Feb 9 05:29:19 2001
@@ -1,6 +1,6 @@
<!--
$Source: /local/repository/php4/ext/mnogosearch/test.php,v $
- $Id: test.php,v 1.9 2001/02/08 13:33:36 gluke Exp $
+ $Id: test.php,v 1.10 2001/02/09 13:29:19 gluke Exp $
-->
<html>
@@ -64,11 +64,13 @@
$rows=Udm_Get_Res_Param($res,UDM_PARAM_NUM_ROWS);
$wordinfo=Udm_Get_Res_Param($res,UDM_PARAM_WORDINFO);
$searchtime=Udm_Get_Res_Param($res,UDM_PARAM_SEARCHTIME);
+ $first_doc=Udm_Get_Res_Param($res,UDM_PARAM_FIRST_DOC);
+ $last_doc=Udm_Get_Res_Param($res,UDM_PARAM_LAST_DOC);
printf("Searchtime: ".$searchtime."\n\n");
- printf("Documents %d-%d from %d total found; %s\n\n",
- $first,$first+$rows-1,$total,$wordinfo);
+ printf("Documents %d(%d)-%d(%d) from %d total found; %s\n\n",
+ $first,$first_doc,$first+$rows-1,$last_doc,$total,$wordinfo);
// Fetch all rows
for($i=0;$i<$rows;$i++){
--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]