cvs: php4 /ext/mnogosearch php_mnogo.c test.php

From: Date: Thu, 15 Feb 2001 11:50:49 +0000
Subject: cvs: php4 /ext/mnogosearch php_mnogo.c test.php
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-4038@lists.php.net to get a copy of this message
gluke Thu Feb 15 03:50:49 2001 EDT Modified files: /php4/ext/mnogosearch php_mnogo.c test.php Log: Added thow new mnoGoSearch agent session parameters: UDM_PARAM_WEIGHT_FACTOR and UDM_PARAM_WORD_MATCH. Index: php4/ext/mnogosearch/php_mnogo.c diff -u php4/ext/mnogosearch/php_mnogo.c:1.14 php4/ext/mnogosearch/php_mnogo.c:1.15 --- php4/ext/mnogosearch/php_mnogo.c:1.14 Wed Feb 14 06:27:45 2001 +++ php4/ext/mnogosearch/php_mnogo.c Thu Feb 15 03:50:48 2001 @@ -1,5 +1,5 @@ /* $Source: /local/repository/php4/ext/mnogosearch/php_mnogo.c,v $ */ -/* $Id: php_mnogo.c,v 1.14 2001/02/14 14:27:45 gluke Exp $ */ +/* $Id: php_mnogo.c,v 1.15 2001/02/15 11:50:48 gluke Exp $ */ /* +----------------------------------------------------------------------+ @@ -52,6 +52,8 @@ #define UDM_PARAM_CHARSET 6 #define UDM_PARAM_STOPTABLE 7 #define UDM_PARAM_STOPFILE 8 +#define UDM_PARAM_WEIGHT_FACTOR 9 +#define UDM_PARAM_WORD_MATCH 10 /* udm_add_search_limit constants */ #define UDM_LIMIT_URL 1 @@ -59,6 +61,7 @@ #define UDM_LIMIT_LANG 3 #define UDM_LIMIT_CAT 4 +/* track modes */ #define UDM_TRACK_ENABLED 1 #define UDM_TRACK_DISABLED 0 @@ -155,6 +158,8 @@ REGISTER_LONG_CONSTANT("UDM_PARAM_STOP_TABLE", 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_STOP_FILE", UDM_PARAM_STOPFILE,CONST_CS | CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("UDM_PARAM_WEIGHT_FACTOR",UDM_PARAM_WEIGHT_FACTOR,CONST_CS | CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("UDM_PARAM_WORD_MATCH", UDM_PARAM_WORD_MATCH,CONST_CS | CONST_PERSISTENT); /* udm_add_search_limit constants */ REGISTER_LONG_CONSTANT("UDM_LIMIT_CAT", UDM_LIMIT_CAT,CONST_CS | CONST_PERSISTENT); @@ -184,6 +189,12 @@ /* 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); + + /* word match mode params */ + REGISTER_LONG_CONSTANT("UDM_MATCH_WORD", UDM_MATCH_WORD,CONST_CS | CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("UDM_MATCH_BEGIN", UDM_MATCH_BEGIN,CONST_CS | CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("UDM_MATCH_SUBSTR", UDM_MATCH_SUBSTR,CONST_CS | CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("UDM_MATCH_END", UDM_MATCH_END,CONST_CS | CONST_PERSISTENT); return SUCCESS; } @@ -330,7 +341,33 @@ } break; + + case UDM_PARAM_WORD_MATCH: + switch (atoi(val)){ + case UDM_MATCH_WORD: + Agent->word_match=UDM_MATCH_WORD; + break; + + case UDM_MATCH_BEGIN: + Agent->word_match=UDM_MATCH_BEGIN; + break; + + case UDM_MATCH_END: + Agent->word_match=UDM_MATCH_END; + break; + + case UDM_MATCH_SUBSTR: + Agent->word_match=UDM_MATCH_SUBSTR; + break; + + default: + php_error(E_WARNING,"Udm_Set_Agent_Param: Unknown word match mode"); + RETURN_FALSE; + break; + } + break; + case UDM_PARAM_CACHE_MODE: switch (atoi(val)){ case UDM_CACHE_ENABLED: @@ -385,6 +422,11 @@ php_error(E_WARNING,Agent->Conf->errstr); RETURN_FALSE; } + + break; + + case UDM_PARAM_WEIGHT_FACTOR: + Agent->weight_factor=strdup(val); break; Index: php4/ext/mnogosearch/test.php diff -u php4/ext/mnogosearch/test.php:1.10 php4/ext/mnogosearch/test.php:1.11 --- php4/ext/mnogosearch/test.php:1.10 Fri Feb 9 05:29:19 2001 +++ php4/ext/mnogosearch/test.php Thu Feb 15 03:50:48 2001 @@ -1,6 +1,6 @@ <!-- $Source: /local/repository/php4/ext/mnogosearch/test.php,v $ - $Id: test.php,v 1.10 2001/02/09 13:29:19 gluke Exp $ + $Id: test.php,v 1.11 2001/02/15 11:50:48 gluke Exp $ --> <html> @@ -37,6 +37,8 @@ Udm_Set_Agent_Param($udm,UDM_PARAM_CHARSET,"koi8-r"); // Udm_Set_Agent_Param($udm,UDM_PARAM_STOPTABLE,"stopword"); // Udm_Set_Agent_Param($udm,UDM_PARAM_STOPFILE,"stop.txt"); + Udm_Set_Agent_Param($udm,UDM_PARAM_WEIGHT_FACTOR,"F9421"); + Udm_Set_Agent_Param($udm,UDM_PARAM_WORD_MATCH,UDM_MATCH_SUBSTR); // Stage 3: add search limits // Udm_Add_Search_Limit($udm,UDM_LIMIT_URL,"http://www.mydomain.com/%");

« previous php.cvs (#4038) next »