UDM_FIELD_ORDER and UDM_FIELD_CRC mnoGoSearch result fields has been added.

Example updated.
@- UDM_FIELD_ORDER and UDM_FIELD_CRC mnoGoSearch result fields
@  has been added. (gluke)
This commit is contained in:
Sergey Kartashoff 2001-02-06 15:40:33 +00:00
parent 0c759c822c
commit 222ac6e30e
2 changed files with 41 additions and 27 deletions

View File

@ -42,6 +42,8 @@
#define UDM_FIELD_SCORE 10
#define UDM_FIELD_RATING 11
#define UDM_FIELD_MODIFIED 12
#define UDM_FIELD_ORDER 13
#define UDM_FIELD_CRC 14
/* udm_set_agent_param constants */
#define UDM_PARAM_PAGE_SIZE 1
@ -126,51 +128,53 @@ DLEXPORT PHP_MINIT_FUNCTION(mnogosearch)
le_res = zend_register_list_destructors_ex(_free_udm_res,NULL,"mnogosearch result",module_number);
REGISTER_LONG_CONSTANT("UDM_FIELD_URLID", UDM_FIELD_URLID,CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("UDM_FIELD_URL", UDM_FIELD_URL,CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("UDM_FIELD_CONTENT",UDM_FIELD_CONTENT,CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("UDM_FIELD_URL", UDM_FIELD_URL,CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("UDM_FIELD_CONTENT", UDM_FIELD_CONTENT,CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("UDM_FIELD_TITLE", UDM_FIELD_TITLE,CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("UDM_FIELD_KEYWORDS",UDM_FIELD_KEYWORDS,CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("UDM_FIELD_KEYWORDS", UDM_FIELD_KEYWORDS,CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("UDM_FIELD_DESC", UDM_FIELD_DESC,CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("UDM_FIELD_DESCRIPTION", UDM_FIELD_DESCRIPTION,CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("UDM_FIELD_TEXT", UDM_FIELD_TEXT,CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("UDM_FIELD_SIZE", UDM_FIELD_SIZE,CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("UDM_FIELD_SCORE", UDM_FIELD_SCORE,CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("UDM_FIELD_RATING", UDM_FIELD_RATING,CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("UDM_FIELD_MODIFIED",UDM_FIELD_MODIFIED,CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("UDM_FIELD_MODIFIED", UDM_FIELD_MODIFIED,CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("UDM_FIELD_ORDER", UDM_FIELD_ORDER,CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("UDM_FIELD_CRC", UDM_FIELD_CRC,CONST_CS | CONST_PERSISTENT);
/* udm_set_agent_param constants */
REGISTER_LONG_CONSTANT("UDM_PARAM_PAGE_SIZE",UDM_PARAM_PAGE_SIZE,CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("UDM_PARAM_PAGE_NUM",UDM_PARAM_PAGE_NUM,CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("UDM_PARAM_SEARCH_MODE",UDM_PARAM_SEARCH_MODE,CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("UDM_PARAM_CACHE_MODE",UDM_PARAM_CACHE_MODE,CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("UDM_PARAM_TRACK_MODE",UDM_PARAM_TRACK_MODE,CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("UDM_PARAM_CHARSET",UDM_PARAM_CHARSET,CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("UDM_PARAM_STOPTABLE",UDM_PARAM_STOPTABLE,CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("UDM_PARAM_STOPFILE",UDM_PARAM_STOPFILE,CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("UDM_PARAM_PAGE_SIZE", UDM_PARAM_PAGE_SIZE,CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("UDM_PARAM_PAGE_NUM", UDM_PARAM_PAGE_NUM,CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("UDM_PARAM_SEARCH_MODE", UDM_PARAM_SEARCH_MODE,CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("UDM_PARAM_CACHE_MODE", UDM_PARAM_CACHE_MODE,CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("UDM_PARAM_TRACK_MODE", UDM_PARAM_TRACK_MODE,CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("UDM_PARAM_CHARSET", UDM_PARAM_CHARSET,CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("UDM_PARAM_STOPTABLE", UDM_PARAM_STOPTABLE,CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("UDM_PARAM_STOPFILE", UDM_PARAM_STOPFILE,CONST_CS | CONST_PERSISTENT);
/* udm_add_search_limit constants */
REGISTER_LONG_CONSTANT("UDM_LIMIT_CAT",UDM_LIMIT_CAT,CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("UDM_LIMIT_URL",UDM_LIMIT_URL,CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("UDM_LIMIT_TAG",UDM_LIMIT_TAG,CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("UDM_LIMIT_LANG",UDM_LIMIT_LANG,CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("UDM_LIMIT_CAT", UDM_LIMIT_CAT,CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("UDM_LIMIT_URL", UDM_LIMIT_URL,CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("UDM_LIMIT_TAG", UDM_LIMIT_TAG,CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("UDM_LIMIT_LANG", UDM_LIMIT_LANG,CONST_CS | CONST_PERSISTENT);
/* udm_get_res_param constants */
REGISTER_LONG_CONSTANT("UDM_PARAM_FOUND",UDM_PARAM_FOUND,CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("UDM_PARAM_NUM_ROWS",UDM_PARAM_NUM_ROWS,CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("UDM_PARAM_WORDINFO",UDM_PARAM_WORDINFO,CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("UDM_PARAM_FOUND", UDM_PARAM_FOUND,CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("UDM_PARAM_NUM_ROWS", UDM_PARAM_NUM_ROWS,CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("UDM_PARAM_WORDINFO", UDM_PARAM_WORDINFO,CONST_CS | CONST_PERSISTENT);
/* search modes */
REGISTER_LONG_CONSTANT("UDM_MODE_ALL",UDM_MODE_ALL,CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("UDM_MODE_ANY",UDM_MODE_ANY,CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("UDM_MODE_BOOL",UDM_MODE_BOOL,CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("UDM_MODE_ALL", UDM_MODE_ALL,CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("UDM_MODE_ANY", UDM_MODE_ANY,CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("UDM_MODE_BOOL", UDM_MODE_BOOL,CONST_CS | CONST_PERSISTENT);
/* search cache params */
REGISTER_LONG_CONSTANT("UDM_CACHE_ENABLED",UDM_CACHE_ENABLED,CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("UDM_CACHE_DISABLED",UDM_CACHE_DISABLED,CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("UDM_CACHE_ENABLED", UDM_CACHE_ENABLED,CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("UDM_CACHE_DISABLED", UDM_CACHE_DISABLED,CONST_CS | CONST_PERSISTENT);
/* track mode params */
REGISTER_LONG_CONSTANT("UDM_TRACK_ENABLED",UDM_TRACK_ENABLED,CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("UDM_TRACK_DISABLED",UDM_TRACK_DISABLED,CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("UDM_TRACK_ENABLED", UDM_TRACK_ENABLED,CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("UDM_TRACK_DISABLED", UDM_TRACK_DISABLED,CONST_CS | CONST_PERSISTENT);
return SUCCESS;
}
@ -569,6 +573,14 @@ DLEXPORT PHP_FUNCTION(udm_get_res_field){
case UDM_FIELD_MODIFIED:
RETURN_LONG((Res->Doc[row].last_mod_time));
break;
case UDM_FIELD_ORDER:
RETURN_LONG((Res->Doc[row].order));
break;
case UDM_FIELD_CRC:
RETURN_LONG((Res->Doc[row].crc32));
break;
default:
php_error(E_WARNING,"Udm_Get_Res_Field: Unknown mnoGoSearch field name");
@ -616,7 +628,7 @@ DLEXPORT PHP_FUNCTION(udm_get_res_param)
case UDM_PARAM_WORDINFO:
RETURN_STRING(Res->wordinfo,1);
break;
default:
php_error(E_WARNING,"Udm_Get_Res_Param: Unknown mnoGoSearch param name");
RETURN_FALSE;

View File

@ -70,6 +70,7 @@
// Fetch all rows
for($i=0;$i<$rows;$i++){
printf("%3d. %s\n",$first+$i,Udm_Get_Res_Field($res,$i,UDM_FIELD_URL));
printf(" ORDER : %d\n",Udm_Get_Res_Field($res,$i,UDM_FIELD_ORDER));
printf(" CONT : %s\n",htmlspecialchars(Udm_Get_Res_Field($res,$i,UDM_FIELD_CONTENT)));
printf(" TITLE: %s\n",htmlspecialchars(Udm_Get_Res_Field($res,$i,UDM_FIELD_TITLE)));
printf(" KEYWORDS: %s\n",htmlspecialchars(Udm_Get_Res_Field($res,$i,UDM_FIELD_KEYWORDS)));
@ -79,6 +80,7 @@
printf(" MODIFIED : %s\n",Udm_Get_Res_Field($res,$i,UDM_FIELD_MODIFIED));
printf(" URLID : %d\n",Udm_Get_Res_Field($res,$i,UDM_FIELD_URLID));
printf(" SCORE : %d\n",Udm_Get_Res_Field($res,$i,UDM_FIELD_SCORE));
printf(" CRC : %d\n",Udm_Get_Res_Field($res,$i,UDM_FIELD_CRC));
printf("---------\n");
}