From 48bc5a490a9d790970850ee0d5b5b1a29531577f Mon Sep 17 00:00:00 2001 From: Egon Schmid Date: Wed, 7 Feb 2001 11:56:30 +0000 Subject: [PATCH] Added the mnogosearch functions. git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@40946 c90b9560-bf6c-de11-be94-00142212c4b1 --- functions/mnogosearch.xml | 462 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 462 insertions(+) create mode 100644 functions/mnogosearch.xml diff --git a/functions/mnogosearch.xml b/functions/mnogosearch.xml new file mode 100644 index 0000000000..1ffc1b0751 --- /dev/null +++ b/functions/mnogosearch.xml @@ -0,0 +1,462 @@ + + mnoGoSearch Functions + mnoGoSearch + + + These functions allow you to access mnoGoSearch (former + UdmSearch) free search engine. In order to have these + functions available, you must compile php with mnogosearch + support by using the option. If you use this option without specifying the + path to mnogosearch, php will look for mnogosearch under + /usr/local/mnogosearch path by default. If you installed + mnogosearch at the other path you should specify it: . + + + + php contains built-in mysql access library, which can be used to + access mysql. It is known that mnoGoSearch is not compatible with + this built-in library and can work only with generic mysql + libraries. Thus, if you use mnoGoSearch with mysql, during php + configuration you have to indicate directory of mysql + installation, i.e. for example: + + + + You need at least 3.1.9 version of mnoGoSearch installed to use + these functions. + + + More information about mnoGoSearch can be found at&url.mnogo;. + + + + + + Udm_Alloc_Agent + Allocate mnoGoSearch session + + + Description + + + int udm_alloc_agent + string dbaddr + string + + dbmode + + + + + + Udm_Alloc_Agent returns mnogosearch agent + identifier on success, false on error. This function creates a + session with database parameters. + + + + In fact this function does not open connection to database and + thus does not check entered login and password. + + + + + + + + Udm_Set_Agent_Param + Set mnoGoSearch agent session parameters + + + Description + + + Udm_Set_Agent_Param + int agent + int var + string val + + + + Udm_Alloc_Agent returns true on success, + false on error. Defines mnoGoSearch session parameters. + + + The following parameters and their values are available: + + + UDM_PARAM_PAGE_NUM used to choose search + results page number (results are returned by pages beginning from + 0, with UDM_PARAM_PAGE_SIZE results per + page). + + + UDM_PARAM_PAGE_SIZE - number of search + results displayed on one page. + + + UDM_PARAM_SEARCH_MODE - search mode. The + following values available: UDM_MODE_ALL - + search for all words UDM_MODE_ANY - search + for any word UDM_MODE_BOOL - boolean + query. + + + UDM_PARAM_CACHE_MODE - turns on or off + search cache mode. Available values: + UDM_CACHE_ENABLED, + UDM_CACHE_DISABLED + + + UDM_PARAM_TRACK_MODE - turns on or off + trackquery mode. Available values: + UDM_TRACK_ENABLED, + UDM_TRACK_DISABLED + + + UDM_PARAM_CHARSET - defines local charset. + Available values: set of charsets supported by mnoGoSearch, + e.g. koi8-r, cp1251, ... + + + UDM_PARAM_STOPFILE - Defines name and path + to stopwords file. (There is a small difference with mnoGoSearch + - if in mnoGoSearch a relative path or no path entered, then it + looks for this file in relation to + UDM_CONF_DIR, while the module looks for + the file in relation to current path, i.e. to the path where the + script is executed.) + + + + + + + Udm_Add_Search_Limit + Add various search limits + + + Description + + + udm_add_search_limit + int agent + int var + string val + + + + Udm_Add_Search_Limit returns true on + success, false on error. + + + + This function is not yet implemented, but it is planned to + define various search restrictions - i.e. by category, tag, + date, etc. by analogy with + Udm_Set_Agent_Param. + + + + + + + + Udm_Find + Perform search + + + Description + + + int udm_find + int agent + string query + + + + Udm_Add_Search_Limit returns true on + success, false on error. + + + The search itself. The first argument - session, the next one - + query itself. To find something just type words you want to find + and press SUBMIT button. For example, "mysql odbc". You should + not use quotes " in query, they are written here only to divide a + query from other text. mnoGoSearch will find all documents that + contain word "mysql" and/or word "odbc". Best documents having + bigger weights will be displayed first. If you use search mode + ALL, search will return documents that contain both (or more) + words you entered. In case you use mode ANY, the search will + return list of documents that contain any of the words you + entered. If you want more advanced results you may use query + language. You should select "bool" match mode in the search + from. + + + mnoGoSearch understands the following boolean operators: + + + & - logical AND. For example, "mysql & + odbc". mnoGoSearch will find any URLs that contain both + "mysql" and "odbc". + + + | - logical OR. For example "mysql|odbc". mnoGoSearch + will find any URLs, that contain word "mysql" or word + "odbc". + + + ~ - logical NOT. For example "mysql & ~odbc". + mnoGoSearch will find URLs that contain word "mysql" + and do not contain word "odbc" at the same time. Note + that ~ just excludes given word from results. Query + "~odbc" will find nothing! + + + () - group command to compose more complex queries. For example + "(mysql | msql) & ~postgres". Query language is + simple and powerful at the same time. Just consider query as + usual boolean expression. + + + + + + + + Udm_Get_Res_Param + Get mnoGoSearch result parameters + + + Description + + + int udm_get_res_param + int res + int param + + + + Udm_Get_Res_Param returns result parameter + value on success, false on error. + + + res - a link to result identifier, + received after call to Udm-Find + + + param - parameter identifier, can have the + following values: + + + UDM_PARAM_NUM_ROWS - number of received + found links on the current page. It is equal to + UDM_PARAM_PAGE_SIZE for all search pages, + on the last page - the rest of links. + + + UDM_PARAM_FOUND - total number of results + matching the query. + + + + + + + Udm_Get_Res_Field + Fetch mnoGoSearch result field + + + Description + + + int udm_get_res_field + int res + int row + int field + + + + Udm_Alloc_Agent result field value on + success, false on error. + + + res - a link to result identifier, + received after call to Udm-Find + + + row - the number of the link on the + current page. May be from 0 to to + UDM_PARAM_NUM_ROWS. + + + field - field identifier, may have the + following values: + + + UDM_FIELD_URL - URL field + + + UDM_FIELD_CONTENT - Content-type field. + + + UDM_FIELD_TITLE - Title fo the page. + + + UDM_FIELD_KEYWORDS - keywords, defined in + the META tag of the page. + + + UDM_FIELD_DESC - description, defined in + the META tag of the page. + + + UDM_FIELD_TEXT - text of the page's body. + + + UDM_FIELD_SIZE - page size. + + + UDM_FIELD_URLID - unique link ID + + + UDM_FIELD_SCORE - page rating. + + + UDM_FIELD_MODIFIED - last_modified field + in unixtime format. + + + + + + + Udm_Free_Res + mnoGoSearch free result + + + Description + + + int udm_free_res + int res + + + + udm_free_res returns true on success, false + on error. + + + res - a link to result identifier, + received after call to Udm-Find + + + Freeing up memory allocated for results. + + + + + + + Udm_Free_Agent + Free mnoGoSearch session + + + Description + + + int udm_free_agent + int agent + + + + udm_free_res returns true on success, false + on error. + + + agent - link to agent identifier, received + after call to Udm_Alloc_Agent + + + Freeing up memory allocated for agent. + + + + + + + Udm_Errno + mnoGoSearch error number + + + Description + + + int udm_errno + int agent + + + + udm_errno returns mnoGoSearch error number, + zero if no error. + + + agent - link to agent identifier, received + after call to Udm_Alloc_Agent + + + Receiving numeric agent error code. + + + + + + + Udm_Error + mnoGoSearch error message + + + Description + + + string udm_error + int agent + + + + udm_error returns mnoGoSearch error message, + empty string if no error. + + + agent - link to agent identifier, received + after call to Udm_Alloc_Agent + + + Receiving agent error message. + + + + + + +