From 116e61f3b48b3de92d71f2ea6f621449d213371b Mon Sep 17 00:00:00 2001 From: Sergey Kartashoff Date: Sat, 24 Feb 2001 05:50:34 +0000 Subject: [PATCH] mnoGoSearch doc update. git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@41804 c90b9560-bf6c-de11-be94-00142212c4b1 --- functions/mnogosearch.xml | 167 ++++++++++++++++++++++++++++++++++++-- 1 file changed, 162 insertions(+), 5 deletions(-) diff --git a/functions/mnogosearch.xml b/functions/mnogosearch.xml index 48c71b18e2..fb207133f6 100644 --- a/functions/mnogosearch.xml +++ b/functions/mnogosearch.xml @@ -267,11 +267,13 @@ - UDM_PARAM_MAX_WORD_LEN - defines maximum word lenght. Any word longer this limit is considered to be a stopword. Please note that this paraneter value is inclusive, - i.e. if UDM_PARAM_MAX_WORD_LEN=32, a word 32 characters long will not be considered a stopword, while - a word 33 characters long will be. Default value is 32. + UDM_PARAM_ISPELL_PREFIXES - Possible values: UDM_PREFIXES_ENABLED and UDM_PREFIXES_DISABLED, + that respectively enable or disable using prefixes. E.g. if a word "tested" is in search query, also words like "test", "testing", etc. + Only suffixes are supported by default. Prefixes usually change word meanings, for example if somebody is searching for the word "tested" + one hardly wants "untested" to be found. Prefixes support may also be found useful for site's + spelling checking purposes. In order to enable ispell, you have to load ispell data with udm_load_ispell_data. - + @@ -344,6 +346,21 @@ cat=010201 in the url. + + + UDM_LIMIT_DATE - defines limitation by date document was modified. + + + Format of parameter value: a string with first character < or >, then with no space - date in unixtime format, for example: + + + Udm_Add_Search_Limit($udm,UDM_LIMIT_DATE,"<908012006"); + + + If > character is used, then search will be restricted to those documents having modification date greater than entered. + If <, then smaller. + + @@ -585,7 +602,147 @@ - + + + + udm_load_ispell_data + Load ispell data + + + Description + + + int udm_load_ispell_data + int agent + int var + string val1 + string val2 + int flag + + + + udm_load_ispell_data loads ispell data. Returns TRUE on success, FALSE on error. + + agent - agent link identifier, received after call to udm_alloc_agent. + + + var - parameter, indicating the source for ispell data. May have the following values: + + + + It is recommended to load ispell data from files, since in mnogosearch 3.1.10 it is the fastest. In later versions + it is planned to optimize loading in UDM_ISPELL_TYPE_DB mode as well, so you just try several modes to find the best for you. + + + + + + UDM_ISPELL_TYPE_DB - indicates that ispell data should be loaded from SQL. In this case, parameters val1 and val2 are ignored and + should be left blank. flag should be equal to 1. + + + + flag indicates that after loading ispell data from defined source it sould be sorted (it is necessary for correct functioning of ispell). + In case of loading ispell data from files there may be several calls to udm_load_ispell_data, and there is no sense to sort data after every call, but only after the last one. + Since in db mode all the data is loaded by one call, this parameter should have the value 1. + In this mode in case of error, e.g. if ispell tables are absent, the function will return FALSE and code and error message will be accessible through udm_error and udm_errno. + + + Example: + + + if (! Udm_Load_Ispell_Data($udm,UDM_ISPELL_TYPE_DB,'','',1)) { + printf("Error #%d: '%s'\n",Udm_Errno($udm),Udm_Error($udm)); + exit; + } + + + + + + UDM_ISPELL_TYPE_AFFIX - indicates that ispell data should be loaded from file and initiates loading affixes file. + In this case val1 defines double letter language code for which affixes are loaded, + and val2 - file path. Please note, that if a relative path entered, the module looks for + the file not in UDM_CONF_DIR, but in relation to current path, i.e. to the path where the script is executed. + In case of error in this mode, e.g. if file is absent, the function will return FALSE, and an error message will be displayed. + Error message text cannot be accessed through udm_error and udm_errno, since those functions + can only return messages associated with SQL. Please, see flag parameter description in UDM_ISPELL_TYPE_DB. + + Example: + + + if ((! Udm_Load_Ispell_Data($udm,UDM_ISPELL_TYPE_AFFIX,'en','/opt/ispell/en.aff',0)) || + (! Udm_Load_Ispell_Data($udm,UDM_ISPELL_TYPE_AFFIX,'ru','/opt/ispell/ru.aff',0)) || + (! Udm_Load_Ispell_Data($udm,UDM_ISPELL_TYPE_SPELL,'en','/opt/ispell/en.dict',0)) || + (! Udm_Load_Ispell_Data($udm,UDM_ISPELL_TYPE_SPELL,'ru','/opt/ispell/ru.dict',1))) { + exit; + } + + + + + flag is equal to 1 only in the last call. + + + + + + UDM_ISPELL_TYPE_SPELL - indicates that ispell data should be loaded from file and initiates loading of ispell dictionary file. + In this case val1 defines double letter language code for which affixes are loaded, + and val2 - file path. Please note, that if a relative path entered, the module looks for + the file not in UDM_CONF_DIR, but in relation to current path, i.e. to the path where the script is executed. + In case of error in this mode, e.g. if file is absent, the function will return FALSE, and an error message will be displayed. + Error message text cannot be accessed through udm_error and udm_errno, since those functions + can only return messages associated with SQL. Please, see flag parameter description in UDM_ISPELL_TYPE_DB. + + Example: + + + if ((! Udm_Load_Ispell_Data($udm,UDM_ISPELL_TYPE_AFFIX,'en','/opt/ispell/en.aff',0)) || + (! Udm_Load_Ispell_Data($udm,UDM_ISPELL_TYPE_AFFIX,'ru','/opt/ispell/ru.aff',0)) || + (! Udm_Load_Ispell_Data($udm,UDM_ISPELL_TYPE_SPELL,'en','/opt/ispell/en.dict',0)) || + (! Udm_Load_Ispell_Data($udm,UDM_ISPELL_TYPE_SPELL,'ru','/opt/ispell/ru.dict',1))) { + exit; + } + + + + + flag is equal to 1 only in the last call. + + + + + + + + + + udm_free_ispell_data + Free memory allocated for ispell data + + + Description + + + int udm_free_ispell_data + int agent + + + + udm_free_ispell_data always returns TRUE. + + + agent - agent link identifier, received after call to udm_alloc_agent. + + + + In mnoGoSearch 3.1.10 this function is not yet implemented, it is added for compatibility with future versions and does not perform anything yet. + + + + + udm_free_res