dim Fri Mar 2 02:02:46 2001 EDT
Modified files:
/phpdoc/en/functions mnogosearch.xml
Log:
Added descriptions of functions: udm_get_doc_count, udm_api_version,
Crosswords support, cosmetic changes
Index: phpdoc/en/functions/mnogosearch.xml
diff -u phpdoc/en/functions/mnogosearch.xml:1.8 phpdoc/en/functions/mnogosearch.xml:1.9
--- phpdoc/en/functions/mnogosearch.xml:1.8 Fri Feb 23 21:50:34 2001
+++ phpdoc/en/functions/mnogosearch.xml Fri Mar 2 02:02:46 2001
@@ -1,4 +1,4 @@
- <reference id="ref.mnogo">
+<reference id="ref.mnogo">
<title>mnoGoSearch Functions</title>
<titleabbrev>mnoGoSearch</titleabbrev>
<partintro>
@@ -46,239 +46,7 @@
</simpara>
</partintro>
- <refentry id="function.udm-alloc-agent">
- <refnamediv>
- <refname>udm_alloc_agent</refname>
- <refpurpose>Allocate mnoGoSearch session</refpurpose>
- </refnamediv>
- <refsect1>
- <title>Description</title>
- <funcsynopsis>
- <funcprototype>
- <funcdef>int <function>udm_alloc_agent</function></funcdef>
- <paramdef>string <parameter>dbaddr</parameter></paramdef>
- <paramdef>string
- <parameter>
- <optional>dbmode</optional>
- </parameter>
- </paramdef>
- </funcprototype>
- </funcsynopsis>
- <para>
- <function>udm_alloc_agent</function> returns mnogosearch agent
- identifier on success, <literal>FALSE</literal> on error. This function creates a
- session with database parameters.
- </para>
- <para>
- <parameter>dbaddr</parameter> - URL-style database description. Options (type,
host, database name, port, user and password) to connect to SQL database.
- Do not matter for built-in text files support. Format: DBAddr
DBType:[//[DBUser[:DBPass]@]DBHost[:DBPort]]/DBName/
- Currently supported DBType values are: mysql, pgsql, msql, solid, mssql, oracle,
ibase. Actually, it does not matter for native libraries support.
- But ODBC users should specify one of supported values. If your database type is
not supported, you may use "unknown" instead.
- </para>
- <para>
- <parameter>dbmode</parameter> - You may select SQL database mode of words
storage. When "single" is specified, all words are stored in the same
- table. If "multi" is selected, words will be located in different tables
depending of their lengths. "multi" mode is usually faster
- but requires more tables in database. If "crc" mode is selected, mnoGoSearch
will store 32 bit integer
- word IDs calculated by CRC32 algorythm instead of words. This mode requres less
disk space and it is faster comparing with "single"
- and "multi" modes. "crc-multi" uses the same storage structure with the "crc"
mode, but also stores words in different tables depending on
- words lengths like "multi" mode. Format: DBMode single/multi/crc/crc-multi
- </para>
- <note>
- <para>
- <parameter>dbaddr</parameter> and <parameter>dbmode</parameter> must match those
used during indexing.
- </para>
- </note>
- <note>
- <para>
- In fact this function does not open connection to database and
- thus does not check entered login and password. Actual connection to database
and login/password verification is done by <function>udm_find</function>.
- </para>
- </note>
- </refsect1>
- </refentry>
-
- <refentry id="function.udm-set-agent-param">
- <refnamediv>
- <refname>udm_set_agent_param</refname>
- <refpurpose>Set mnoGoSearch agent session parameters</refpurpose>
- </refnamediv>
- <refsect1>
- <title>Description</title>
- <funcsynopsis>
- <funcprototype>
- <funcdef>int <function>udm_set_agent_param</function></funcdef>
- <paramdef>int <parameter>agent</parameter></paramdef>
- <paramdef>int <parameter>var</parameter></paramdef>
- <paramdef>string <parameter>val</parameter></paramdef>
- </funcprototype>
- </funcsynopsis>
- <para>
- <function>udm_set_agent_param</function> returns <literal>TRUE</literal> on
success,
- <literal>FALSE</literal> on error. Defines mnoGoSearch session parameters.
- </para>
- <simpara>
- The following parameters and their values are available:
- </simpara>
- <itemizedlist>
- <listitem>
- <simpara>
- 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).
- </simpara>
- </listitem>
- <listitem>
- <simpara>
- UDM_PARAM_PAGE_SIZE - number of search results displayed on one page.
- </simpara>
- </listitem>
- <listitem>
- <simpara>
- 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_PHRASE -
phrase search; UDM_MODE_BOOL - boolean search. See <function>udm_find</function> for
details on boolean search.
- </simpara>
- </listitem>
- <listitem>
- <simpara>
- UDM_PARAM_CACHE_MODE - turns on or off search result cache mode. When enabled,
the search engine will store
- search results to disk. In case a similar search is performed later, the
engine will take results from the cache for faster performance.
- Available values: UDM_CACHE_ENABLED, UDM_CACHE_DISABLED.
- </simpara>
- </listitem>
- <listitem>
- <simpara>
- UDM_PARAM_TRACK_MODE - turns on or off trackquery mode. Since version 3.1.2
mnoGoSearch has a query tracking support.
- Note that tracking is implemented in SQL version only and not available in
built-in database.
- To use tracking, you have to create tables for tracking support. For MySQL,
use create/mysql/track.txt.
- When doing a search, front-end uses those tables to store query words, a
number of found documents and current UNIX timestamp in seconds.
- Available values: UDM_TRACK_ENABLED, UDM_TRACK_DISABLED.
- </simpara>
- </listitem>
- <listitem>
- <simpara>
- UDM_PARAM_PHRASE_MODE - defines whether index database using phrases ("phrase"
parameter in indexer.conf).
- Possible values: UDM_PHRASE_ENABLED and UDM_PHRASE_DISABLED.
- Please note, that if phrase search is enabled (UDM_PHRASE_ENABLED),
- it is still possible to do search in any mode (ANY, ALL, BOOL or PHRASE).
- In 3.1.10 version of mnoGoSearch phrase search is supported only in sql and
buuilt-in database modes,
- while beginning with 3.1.11 phrases are supported in cachemode as well.
- </simpara>
- <simpara>
- Examples of phrase search:
- </simpara>
- <simpara>
- "Arizona desert" - This query returns all indexed documents that contain
"Arizona desert" as a phrase. Notice that you need to put double quotes around the
phrase
- </simpara>
- </listitem>
- <listitem>
- <simpara>
- UDM_PARAM_CHARSET - defines local charset. Available values: set of charsets
supported by mnoGoSearch,
- e.g. koi8-r, cp1251, ...
- </simpara>
- </listitem>
- <listitem>
- <simpara>
- UDM_PARAM_STOPFILE - Defines name and path
- to stopwords file. (There is a small difference with mnoGoSearch
- - while in mnoGoSearch if relative path or no path entered, it
- looks for this file in relation to UDM_CONF_DIR, the module looks for
- the file in relation to current path, i.e. to the path where the
- php script is executed.)
- </simpara>
- </listitem>
- <listitem>
- <simpara>
- UDM_PARAM_STOPTABLE - Load stop words from the given SQL table. You may use
several StopwordTable commands.
- This command has no effect when compiled without SQL database support.
- </simpara>
- </listitem>
- <listitem>
- <simpara>
-
- UDM_PARAM_WEIGHT_FACTOR - represents weight factors for specific document
parts. Currently body, title, keywords, description, url are supported.
- To activate this feature please use degrees of 2 in *Weight commands of
- the indexer.conf. Let's imagine that we have these weights:
- </simpara>
- <simpara>URLWeight 1</simpara>
- <simpara>BodyWeight 2</simpara>
- <simpara>TitleWeight 4</simpara>
- <simpara>KeywordWeight 8</simpara>
- <simpara>DescWeight 16</simpara>
- <simpara>
- As far as indexer uses bit OR operation for word weights when some
- word presents several time in the same document, it is possible at search
- time to detect word appearance in different document parts. Word which
- appears only in the body will have 00000010 argegate weight (in binary
notation).
- Word used in all document parts will have 00011111 aggregate weight.
- </simpara>
- <simpara>
- This parameter's value is a string of hex digits ABCDE. Each digit is a factor
for corresponding bit in word weight. For the given above weights
- configuration:
- </simpara>
- <simpara>E is a factor for weight 1 (URL Weight bit)</simpara>
- <simpara>D is a factor for weight 2 (BodyWeight bit)</simpara>
- <simpara>C is a factor for weight 4 (TitleWeight bit)</simpara>
- <simpara>B is a factor for weight 8 (KeywordWeight bit)</simpara>
- <simpara>A is a factor for weight 16 (DescWeight bit)</simpara>
- <simpara>
- Examples:
- </simpara>
- <simpara>
- UDM_PARAM_WEIGHT_FACTOR=00001 will search through URLs only.
- </simpara>
- <simpara>
- UDM_PARAM_WEIGHT_FACTOR=00100 will search through Titles only.
- </simpara>
- <simpara>
- UDM_PARAM_WEIGHT_FACTOR=11100 will search through Title,Keywords,Desctription
but not through URL and Body.
- </simpara>
- <simpara>
- UDM_PARAM_WEIGHT_FACTOR=F9421 will search through:
- </simpara>
- <simpara>Description with factor 15 (F hex)</simpara>
- <simpara>Keywords with factor 9</simpara>
- <simpara>Title with factor 4</simpara>
- <simpara>Body with factor 2</simpara>
- <simpara>URL with factor 1</simpara>
- <simpara>
- If UDM_PARAM_WEIGHT_FACTOR variable is ommited, original weight value is
- taken to sort results. For a given above weight configuration it means
- that document description has a most big weight 16.
- </simpara>
- </listitem>
- <listitem>
- <simpara>
- UDM_PARAM_WORD_MATCH - word match. You may use this parameter to choose word
match type. This feature works only
- in "single" and "multi" modes using SQL based and built-in database. It does
not work in cachemode and other modes
- since they use word CRC and do not support substring search.
- Available values:
- </simpara>
- <simpara>UDM_MATCH_BEGIN - word beginning match;</simpara>
- <simpara>UDM_MATCH_END - word ending match;</simpara>
- <simpara>UDM_MATCH_WORD - whole word match;</simpara>
- <simpara>UDM_MATCH_SUBSTR - word substring match.</simpara>
- </listitem>
- <listitem>
- <simpara>
- UDM_PARAM_MIN_WORD_LEN - defines minimal word length.
- Any word shorter this limit is considered to be a stopword. Please note that
this paraneter value is inclusive,
- i.e. if UDM_PARAM_MIN_WORD_LEN=3, a word 3 characters long will not be
considered a stopword, while
- a word 2 characters long will be. Default value is 1.
- </simpara>
- </listitem>
- <listitem>
- <simpara>
- 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 <function>udm_load_ispell_data</function>.
- </simpara>
- </listitem>
- </itemizedlist>
- </refsect1>
- </refentry>
-
- <refentry id="function.udm-add-search-limit">
+ <refentry id="function.udm-add-search-limit">
<refnamediv>
<refname>udm_add_search_limit</refname>
<refpurpose>Add various search limits</refpurpose>
@@ -364,29 +132,167 @@
</itemizedlist>
</refsect1>
</refentry>
-
-<refentry id="function.udm-clear-search-limits">
+
+ <refentry id="function.udm-alloc-agent">
<refnamediv>
- <refname>udm_clear_search_limits</refname>
- <refpurpose>Clear all mnoGoSearch search restrictions</refpurpose>
+ <refname>udm_alloc_agent</refname>
+ <refpurpose>Allocate mnoGoSearch session</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<funcsynopsis>
<funcprototype>
- <funcdef>int <function>udm_clear_search_limits</function></funcdef>
- <paramdef>int <parameter>agent</parameter></paramdef>
+ <funcdef>int <function>udm_alloc_agent</function></funcdef>
+ <paramdef>string <parameter>dbaddr</parameter></paramdef>
+ <paramdef>string
+ <parameter>
+ <optional>dbmode</optional>
+ </parameter>
+ </paramdef>
</funcprototype>
</funcsynopsis>
<para>
- <function>udm_clear_search_limits</function> resets defined search limitations
and returns <literal>TRUE</literal>.
+ <function>udm_alloc_agent</function> returns mnogosearch agent
+ identifier on success, <literal>FALSE</literal> on error. This function creates a
+ session with database parameters.
</para>
- </refsect1>
- </refentry>
-
- <refentry id="function.udm-find">
- <refnamediv>
- <refname>udm_find</refname>
+ <para>
+ <parameter>dbaddr</parameter> - URL-style database description. Options (type,
+host, database name, port, user and password) to connect to SQL database.
+ Do not matter for built-in text files support. Format: DBAddr
+DBType:[//[DBUser[:DBPass]@]DBHost[:DBPort]]/DBName/
+ Currently supported DBType values are: mysql, pgsql, msql, solid, mssql, oracle,
+ibase. Actually, it does not matter for native libraries support.
+ But ODBC users should specify one of supported values. If your database type is
+not supported, you may use "unknown" instead.
+ </para>
+ <para>
+ <parameter>dbmode</parameter> - You may select SQL database mode of words
+storage. When "single" is specified, all words are stored in the same
+ table. If "multi" is selected, words will be located in different tables
+depending of their lengths. "multi" mode is usually faster
+ but requires more tables in database. If "crc" mode is selected, mnoGoSearch
+will store 32 bit integer
+ word IDs calculated by CRC32 algorythm instead of words. This mode requres less
+disk space and it is faster comparing with "single"
+ and "multi" modes. "crc-multi" uses the same storage structure with the "crc"
+mode, but also stores words in different tables depending on
+ words lengths like "multi" mode. Format: DBMode single/multi/crc/crc-multi
+ </para>
+ <note>
+ <para>
+ <parameter>dbaddr</parameter> and <parameter>dbmode</parameter> must match those
+used during indexing.
+ </para>
+ </note>
+ <note>
+ <para>
+ In fact this function does not open connection to database and
+ thus does not check entered login and password. Actual connection to database
+and login/password verification is done by <function>udm_find</function>.
+ </para>
+ </note>
+ </refsect1>
+ </refentry>
+
+ <refentry id="function.udm-api-version">
+ <refnamediv>
+ <refname>udm_api_version</refname>
+ <refpurpose>Get mnoGoSearch API version.</refpurpose>
+ </refnamediv>
+ <refsect1>
+ <title>Description</title>
+ <funcsynopsis>
+ <funcprototype>
+ <funcdef>int <function>udm_api_version</function></funcdef>
+ <paramdef><parameter></parameter></paramdef>
+ </funcprototype>
+ </funcsynopsis>
+ <para>
+ <function>udm_api_version</function> returns mnoGoSearch API version number.
+E.g. if
+ mnoGoSearch 3.1.10 API is used, this function will return
+<literal>30110</literal>.
+ </para>
+ <para>
+ This function allows user to identify which API functions are available, e.g.
+ <function>udm_get_doc_count</function> function is only available in mnoGoSearch
+3.1.11 or later.
+ </para>
+ <simpara>Example:</simpara>
+ <informalexample>
+ <programlisting role="C">
+ if (Udm_Api_Version() >= 30111) {
+ print "Total number of urls in database:
+".Udm_Get_Doc_Count($udm)."<br>\n";
+ }
+
+ </programlisting>
+ </informalexample>
+ </refsect1>
+ </refentry>
+
+ <refentry id="function.udm-clear-search-limits">
+ <refnamediv>
+ <refname>udm_clear_search_limits</refname>
+ <refpurpose>Clear all mnoGoSearch search restrictions</refpurpose>
+ </refnamediv>
+ <refsect1>
+ <title>Description</title>
+ <funcsynopsis>
+ <funcprototype>
+ <funcdef>int <function>udm_clear_search_limits</function></funcdef>
+ <paramdef>int <parameter>agent</parameter></paramdef>
+ </funcprototype>
+ </funcsynopsis>
+ <para>
+ <function>udm_clear_search_limits</function> resets defined search limitations
+and returns <literal>TRUE</literal>.
+ </para>
+ </refsect1>
+ </refentry>
+
+ <refentry id="function.udm-errno">
+ <refnamediv>
+ <refname>udm_errno</refname>
+ <refpurpose>Get mnoGoSearch error number</refpurpose>
+ </refnamediv>
+ <refsect1>
+ <title>Description</title>
+ <funcsynopsis>
+ <funcprototype>
+ <funcdef>int <function>udm_errno</function></funcdef>
+ <paramdef>int <parameter>agent</parameter></paramdef>
+ </funcprototype>
+ </funcsynopsis>
+ <para>
+ <function>udm_errno</function> returns mnoGoSearch error number,
+ zero if no error.
+ </para>
+ <para>
+ <parameter>agent</parameter> - link to agent identifier, received
+ after call to <function>udm_alloc_agent</function>.
+ </para>
+ <para>
+ Receiving numeric agent error code.
+ </para>
+ </refsect1>
+ </refentry>
+
+ <refentry id="function.udm-error">
+ <refnamediv>
+ <refname>udm_error</refname>
+ <refpurpose>Get mnoGoSearch error message</refpurpose>
+ </refnamediv>
+ <refsect1>
+ <title>Description</title>
+ <funcsynopsis>
+ <funcprototype>
+ <funcdef>string <function>udm_error</function></funcdef>
+ <paramdef>int <parameter>agent</parameter></paramdef>
+ </funcprototype>
+ </funcsynopsis>
+ <para>
+ <function>udm_error</function> returns mnoGoSearch error message,
+ empty string if no error.
+ </para>
+ <para>
+ <parameter>agent</parameter> - link to agent identifier, received
+ after call to <function>udm_alloc_agent</function>.
+ </para>
+ <para>
+ Receiving agent error message.
+ </para>
+ </refsect1>
+ </refentry>
+
+ <refentry id="function.udm-find">
+ <refnamediv>
+ <refname>udm_find</refname>
<refpurpose>Perform search</refpurpose>
</refnamediv>
<refsect1>
@@ -446,68 +352,113 @@
</refsect1>
</refentry>
- <refentry id="function.udm-get-res-param">
+ <refentry id="function.udm-free-agent">
<refnamediv>
- <refname>udm_get_res_param</refname>
- <refpurpose>Get mnoGoSearch result parameters</refpurpose>
+ <refname>udm_free_agent</refname>
+ <refpurpose>Free mnoGoSearch session</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<funcsynopsis>
<funcprototype>
- <funcdef>string <function>udm_get_res_param</function></funcdef>
+ <funcdef>int <function>udm_free_agent</function></funcdef>
+ <paramdef>int <parameter>agent</parameter></paramdef>
+ </funcprototype>
+ </funcsynopsis>
+ <para>
+ <function>udm_free_agent</function> returns <literal>TRUE</literal> on success,
+<literal>FALSE</literal> on error.
+ </para>
+ <para>
+ <parameter>agent</parameter> - link to agent identifier, received
+ after call to <function>udm_alloc_agent</function>.
+ </para>
+ <para>
+ Freeing up memory allocated for agent session.
+ </para>
+ </refsect1>
+ </refentry>
+
+ <refentry id="function.udm-free-ispell-data">
+ <refnamediv>
+ <refname>udm_free_ispell_data</refname>
+ <refpurpose>Free memory allocated for ispell data</refpurpose>
+ </refnamediv>
+ <refsect1>
+ <title>Description</title>
+ <funcsynopsis>
+ <funcprototype>
+ <funcdef>int <function>udm_free_ispell_data</function></funcdef>
+ <paramdef>int <parameter>agent</parameter></paramdef>
+ </funcprototype>
+ </funcsynopsis>
+ <para>
+ <function>udm_free_ispell_data</function> always returns <literal>TRUE</literal>.
+ </para>
+ <para>
+ <parameter>agent</parameter> - agent link identifier, received after call to
+<function>udm_alloc_agent</function>.
+ </para>
+ <note>
+ <para>
+ 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.
+ </para>
+ </note>
+ </refsect1>
+ </refentry>
+
+ <refentry id="function.udm-free-res">
+ <refnamediv>
+ <refname>udm_free_res</refname>
+ <refpurpose>Free mnoGoSearch result</refpurpose>
+ </refnamediv>
+ <refsect1>
+ <title>Description</title>
+ <funcsynopsis>
+ <funcprototype>
+ <funcdef>int <function>udm_free_res</function></funcdef>
<paramdef>int <parameter>res</parameter></paramdef>
- <paramdef>int <parameter>param</parameter></paramdef>
</funcprototype>
</funcsynopsis>
<para>
- <function>udm_get_res_param</function> returns result parameter
- value on success, <literal>FALSE</literal> on error.
+ <function>udm_free_res</function> returns <literal>TRUE</literal> on success,
+<literal>FALSE</literal> on error.
</para>
<para>
<parameter>res</parameter> - a link to result identifier,
received after call to <function>udm_find</function>.
</para>
<para>
- <parameter>param</parameter> - parameter identifier, may have the
- following values:
+ Freeing up memory allocated for results.
</para>
- <itemizedlist>
- <listitem>
- <simpara>
- 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.
- </simpara>
- </listitem>
- <listitem>
- <simpara>
- UDM_PARAM_FOUND - total number of results matching the query.
- </simpara>
- </listitem>
- <listitem>
- <simpara>
- UDM_PARAM_WORDINFO - information on the words found. E.g. search for "a good
book" will return "a: stopword, good:5637, book: 120"
- </simpara>
- </listitem>
- <listitem>
- <simpara>
- UDM_PARAM_SEARCHTIME - search time in seconds.
- </simpara>
- </listitem>
- <listitem>
- <simpara>
- UDM_PARAM_FIRST_DOC - the number of the first document displayed on current
page.
- </simpara>
- </listitem>
- <listitem>
- <simpara>
- UDM_PARAM_LAST_DOC - the number of the last document displayed on current page.
- </simpara>
- </listitem>
- </itemizedlist>
</refsect1>
</refentry>
+ <refentry id="function.udm-get-doc-count">
+ <refnamediv>
+ <refname>udm_get_doc_count</refname>
+ <refpurpose>Get total number of documents in database.</refpurpose>
+ </refnamediv>
+ <refsect1>
+ <title>Description</title>
+ <funcsynopsis>
+ <funcprototype>
+ <funcdef>int <function>udm_get_doc_count</function></funcdef>
+ <paramdef>int <parameter>agent</parameter></paramdef>
+ </funcprototype>
+ </funcsynopsis>
+ <para>
+ <function>udm_get_doc_count</function> returns nuimber of documents in database.
+ </para>
+ <para>
+ <parameter>agent</parameter> - link to agent identifier, received
+ after call to <function>udm_alloc_agent</function>.
+ </para>
+ <note>
+ <simpara>
+ This function is supported only in mnoGoSearch 3.1.11 or later.
+ </simpara>
+ </note>
+ </refsect1>
+ </refentry>
+
<refentry id="function.udm-get-res-field">
<refnamediv>
<refname>udm_get_res_field</refname>
@@ -601,20 +552,83 @@
</listitem>
</itemizedlist>
</refsect1>
- </refentry>
-
- <refentry id="function.udm-load-ispell-data">
+ </refentry>
+
+ <refentry id="function.udm-get-res-param">
<refnamediv>
- <refname>udm_load_ispell_data</refname>
- <refpurpose>Load ispell data</refpurpose>
+ <refname>udm_get_res_param</refname>
+ <refpurpose>Get mnoGoSearch result parameters</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<funcsynopsis>
<funcprototype>
- <funcdef>int <function>udm_load_ispell_data</function></funcdef>
- <paramdef>int <parameter>agent</parameter></paramdef>
- <paramdef>int <parameter>var</parameter></paramdef>
+ <funcdef>string <function>udm_get_res_param</function></funcdef>
+ <paramdef>int <parameter>res</parameter></paramdef>
+ <paramdef>int <parameter>param</parameter></paramdef>
+ </funcprototype>
+ </funcsynopsis>
+ <para>
+ <function>udm_get_res_param</function> returns result parameter
+ value on success, <literal>FALSE</literal> on error.
+ </para>
+ <para>
+ <parameter>res</parameter> - a link to result identifier,
+ received after call to <function>udm_find</function>.
+ </para>
+ <para>
+ <parameter>param</parameter> - parameter identifier, may have the
+ following values:
+ </para>
+ <itemizedlist>
+ <listitem>
+ <simpara>
+ 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.
+ </simpara>
+ </listitem>
+ <listitem>
+ <simpara>
+ UDM_PARAM_FOUND - total number of results matching the query.
+ </simpara>
+ </listitem>
+ <listitem>
+ <simpara>
+ UDM_PARAM_WORDINFO - information on the words found. E.g. search for "a good
+book" will return "a: stopword, good:5637, book: 120"
+ </simpara>
+ </listitem>
+ <listitem>
+ <simpara>
+ UDM_PARAM_SEARCHTIME - search time in seconds.
+ </simpara>
+ </listitem>
+ <listitem>
+ <simpara>
+ UDM_PARAM_FIRST_DOC - the number of the first document displayed on current
+page.
+ </simpara>
+ </listitem>
+ <listitem>
+ <simpara>
+ UDM_PARAM_LAST_DOC - the number of the last document displayed on current page.
+ </simpara>
+ </listitem>
+ </itemizedlist>
+ </refsect1>
+ </refentry>
+
+
+ <refentry id="function.udm-load-ispell-data">
+ <refnamediv>
+ <refname>udm_load_ispell_data</refname>
+ <refpurpose>Load ispell data</refpurpose>
+ </refnamediv>
+ <refsect1>
+ <title>Description</title>
+ <funcsynopsis>
+ <funcprototype>
+ <funcdef>int <function>udm_load_ispell_data</function></funcdef>
+ <paramdef>int <parameter>agent</parameter></paramdef>
+ <paramdef>int <parameter>var</parameter></paramdef>
<paramdef>string <parameter>val1</parameter></paramdef>
<paramdef>string <parameter>val2</parameter></paramdef>
<paramdef>int <parameter>flag</parameter></paramdef>
@@ -715,140 +729,204 @@
</itemizedlist>
</refsect1>
</refentry>
-
- <refentry id="function.udm-free-ispell-data">
- <refnamediv>
- <refname>udm_free_ispell_data</refname>
- <refpurpose>Free memory allocated for ispell data</refpurpose>
- </refnamediv>
- <refsect1>
- <title>Description</title>
- <funcsynopsis>
- <funcprototype>
- <funcdef>int <function>udm_free_ispell_data</function></funcdef>
- <paramdef>int <parameter>agent</parameter></paramdef>
- </funcprototype>
- </funcsynopsis>
- <para>
- <function>udm_free_ispell_data</function> always returns <literal>TRUE</literal>.
- </para>
- <para>
- <parameter>agent</parameter> - agent link identifier, received after call to
<function>udm_alloc_agent</function>.
- </para>
- <note>
- <para>
- 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.
- </para>
- </note>
- </refsect1>
- </refentry>
-
- <refentry id="function.udm-free-res">
- <refnamediv>
- <refname>udm_free_res</refname>
- <refpurpose>Free mnoGoSearch result</refpurpose>
- </refnamediv>
- <refsect1>
- <title>Description</title>
- <funcsynopsis>
- <funcprototype>
- <funcdef>int <function>udm_free_res</function></funcdef>
- <paramdef>int <parameter>res</parameter></paramdef>
- </funcprototype>
- </funcsynopsis>
- <para>
- <function>udm_free_res</function> returns <literal>TRUE</literal> on success,
<literal>FALSE</literal> on error.
- </para>
- <para>
- <parameter>res</parameter> - a link to result identifier,
- received after call to <function>udm_find</function>.
- </para>
- <para>
- Freeing up memory allocated for results.
- </para>
- </refsect1>
- </refentry>
- <refentry id="function.udm-free-agent">
- <refnamediv>
- <refname>udm_free_agent</refname>
- <refpurpose>Free mnoGoSearch session</refpurpose>
- </refnamediv>
- <refsect1>
- <title>Description</title>
- <funcsynopsis>
- <funcprototype>
- <funcdef>int <function>udm_free_agent</function></funcdef>
- <paramdef>int <parameter>agent</parameter></paramdef>
- </funcprototype>
- </funcsynopsis>
- <para>
- <function>udm_free_agent</function> returns <literal>TRUE</literal> on success,
<literal>FALSE</literal> on error.
- </para>
- <para>
- <parameter>agent</parameter> - link to agent identifier, received
- after call to <function>udm_alloc_agent</function>.
- </para>
- <para>
- Freeing up memory allocated for agent session.
- </para>
- </refsect1>
- </refentry>
-
- <refentry id="function.udm-errno">
- <refnamediv>
- <refname>udm_errno</refname>
- <refpurpose>Get mnoGoSearch error number</refpurpose>
- </refnamediv>
- <refsect1>
- <title>Description</title>
- <funcsynopsis>
- <funcprototype>
- <funcdef>int <function>udm_errno</function></funcdef>
- <paramdef>int <parameter>agent</parameter></paramdef>
- </funcprototype>
- </funcsynopsis>
- <para>
- <function>udm_errno</function> returns mnoGoSearch error number,
- zero if no error.
- </para>
- <para>
- <parameter>agent</parameter> - link to agent identifier, received
- after call to <function>udm_alloc_agent</function>.
- </para>
- <para>
- Receiving numeric agent error code.
- </para>
- </refsect1>
- </refentry>
-
- <refentry id="function.udm-error">
+ <refentry id="function.udm-set-agent-param">
<refnamediv>
- <refname>udm_error</refname>
- <refpurpose>Get mnoGoSearch error message</refpurpose>
+ <refname>udm_set_agent_param</refname>
+ <refpurpose>Set mnoGoSearch agent session parameters</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<funcsynopsis>
<funcprototype>
- <funcdef>string <function>udm_error</function></funcdef>
+ <funcdef>int <function>udm_set_agent_param</function></funcdef>
<paramdef>int <parameter>agent</parameter></paramdef>
+ <paramdef>int <parameter>var</parameter></paramdef>
+ <paramdef>string <parameter>val</parameter></paramdef>
</funcprototype>
</funcsynopsis>
- <para>
- <function>udm_error</function> returns mnoGoSearch error message,
- empty string if no error.
- </para>
- <para>
- <parameter>agent</parameter> - link to agent identifier, received
- after call to <function>udm_alloc_agent</function>.
- </para>
<para>
- Receiving agent error message.
+ <function>udm_set_agent_param</function> returns <literal>TRUE</literal> on
+success,
+ <literal>FALSE</literal> on error. Defines mnoGoSearch session parameters.
</para>
- </refsect1>
+ <simpara>
+ The following parameters and their values are available:
+ </simpara>
+ <itemizedlist>
+ <listitem>
+ <simpara>
+ 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).
+ </simpara>
+ </listitem>
+ <listitem>
+ <simpara>
+ UDM_PARAM_PAGE_SIZE - number of search results displayed on one page.
+ </simpara>
+ </listitem>
+ <listitem>
+ <simpara>
+ 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_PHRASE -
+phrase search; UDM_MODE_BOOL - boolean search. See <function>udm_find</function> for
+details on boolean search.
+ </simpara>
+ </listitem>
+ <listitem>
+ <simpara>
+ UDM_PARAM_CACHE_MODE - turns on or off search result cache mode. When enabled,
+the search engine will store
+ search results to disk. In case a similar search is performed later, the
+engine will take results from the cache for faster performance.
+ Available values: UDM_CACHE_ENABLED, UDM_CACHE_DISABLED.
+ </simpara>
+ </listitem>
+ <listitem>
+ <simpara>
+ UDM_PARAM_TRACK_MODE - turns on or off trackquery mode. Since version 3.1.2
+mnoGoSearch has a query tracking support.
+ Note that tracking is implemented in SQL version only and not available in
+built-in database.
+ To use tracking, you have to create tables for tracking support. For MySQL,
+use create/mysql/track.txt.
+ When doing a search, front-end uses those tables to store query words, a
+number of found documents and current UNIX timestamp in seconds.
+ Available values: UDM_TRACK_ENABLED, UDM_TRACK_DISABLED.
+ </simpara>
+ </listitem>
+ <listitem>
+ <simpara>
+ UDM_PARAM_PHRASE_MODE - defines whether index database using phrases ("phrase"
+parameter in indexer.conf).
+ Possible values: UDM_PHRASE_ENABLED and UDM_PHRASE_DISABLED.
+ Please note, that if phrase search is enabled (UDM_PHRASE_ENABLED),
+ it is still possible to do search in any mode (ANY, ALL, BOOL or PHRASE).
+ In 3.1.10 version of mnoGoSearch phrase search is supported only in sql and
+buuilt-in database modes,
+ while beginning with 3.1.11 phrases are supported in cachemode as well.
+ </simpara>
+ <simpara>
+ Examples of phrase search:
+ </simpara>
+ <simpara>
+ "Arizona desert" - This query returns all indexed documents that contain
+"Arizona desert" as a phrase. Notice that you need to put double quotes around the
+phrase
+ </simpara>
+ </listitem>
+ <listitem>
+ <simpara>
+ UDM_PARAM_CHARSET - defines local charset. Available values: set of charsets
+supported by mnoGoSearch,
+ e.g. koi8-r, cp1251, ...
+ </simpara>
+ </listitem>
+ <listitem>
+ <simpara>
+ UDM_PARAM_STOPFILE - Defines name and path
+ to stopwords file. (There is a small difference with mnoGoSearch
+ - while in mnoGoSearch if relative path or no path entered, it
+ looks for this file in relation to UDM_CONF_DIR, the module looks for
+ the file in relation to current path, i.e. to the path where the
+ php script is executed.)
+ </simpara>
+ </listitem>
+ <listitem>
+ <simpara>
+ UDM_PARAM_STOPTABLE - Load stop words from the given SQL table. You may use
+several StopwordTable commands.
+ This command has no effect when compiled without SQL database support.
+ </simpara>
+ </listitem>
+ <listitem>
+ <simpara>
+ UDM_PARAM_WEIGHT_FACTOR - represents weight factors for specific document
+parts. Currently body, title, keywords, description, url are supported.
+ To activate this feature please use degrees of 2 in *Weight commands of
+ the indexer.conf. Let's imagine that we have these weights:
+ </simpara>
+ <simpara>URLWeight 1</simpara>
+ <simpara>BodyWeight 2</simpara>
+ <simpara>TitleWeight 4</simpara>
+ <simpara>KeywordWeight 8</simpara>
+ <simpara>DescWeight 16</simpara>
+ <simpara>
+ As far as indexer uses bit OR operation for word weights when some
+ word presents several time in the same document, it is possible at search
+ time to detect word appearance in different document parts. Word which
+ appears only in the body will have 00000010 argegate weight (in binary
+notation).
+ Word used in all document parts will have 00011111 aggregate weight.
+ </simpara>
+ <simpara>
+ This parameter's value is a string of hex digits ABCDE. Each digit is a factor
+for corresponding bit in word weight. For the given above weights
+ configuration:
+ </simpara>
+ <simpara>E is a factor for weight 1 (URL Weight bit)</simpara>
+ <simpara>D is a factor for weight 2 (BodyWeight bit)</simpara>
+ <simpara>C is a factor for weight 4 (TitleWeight bit)</simpara>
+ <simpara>B is a factor for weight 8 (KeywordWeight bit)</simpara>
+ <simpara>A is a factor for weight 16 (DescWeight bit)</simpara>
+ <simpara>
+ Examples:
+ </simpara>
+ <simpara>
+ UDM_PARAM_WEIGHT_FACTOR=00001 will search through URLs only.
+ </simpara>
+ <simpara>
+ UDM_PARAM_WEIGHT_FACTOR=00100 will search through Titles only.
+ </simpara>
+ <simpara>
+ UDM_PARAM_WEIGHT_FACTOR=11100 will search through Title,Keywords,Desctription
+but not through URL and Body.
+ </simpara>
+ <simpara>
+ UDM_PARAM_WEIGHT_FACTOR=F9421 will search through:
+ </simpara>
+ <simpara>Description with factor 15 (F hex)</simpara>
+ <simpara>Keywords with factor 9</simpara>
+ <simpara>Title with factor 4</simpara>
+ <simpara>Body with factor 2</simpara>
+ <simpara>URL with factor 1</simpara>
+ <simpara>
+ If UDM_PARAM_WEIGHT_FACTOR variable is ommited, original weight value is
+ taken to sort results. For a given above weight configuration it means
+ that document description has a most big weight 16.
+ </simpara>
+ </listitem>
+ <listitem>
+ <simpara>
+ UDM_PARAM_WORD_MATCH - word match. You may use this parameter to choose word
+match type. This feature works only
+ in "single" and "multi" modes using SQL based and built-in database. It does
+not work in cachemode and other modes
+ since they use word CRC and do not support substring search.
+ Available values:
+ </simpara>
+ <simpara>UDM_MATCH_BEGIN - word beginning match;</simpara>
+ <simpara>UDM_MATCH_END - word ending match;</simpara>
+ <simpara>UDM_MATCH_WORD - whole word match;</simpara>
+ <simpara>UDM_MATCH_SUBSTR - word substring match.</simpara>
+ </listitem>
+ <listitem>
+ <simpara>
+ UDM_PARAM_MIN_WORD_LEN - defines minimal word length.
+ Any word shorter this limit is considered to be a stopword. Please note that
+this paraneter value is inclusive,
+ i.e. if UDM_PARAM_MIN_WORD_LEN=3, a word 3 characters long will not be
+considered a stopword, while
+ a word 2 characters long will be. Default value is 1.
+ </simpara>
+ </listitem>
+ <listitem>
+ <simpara>
+ 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 <function>udm_load_ispell_data</function>.
+ </simpara>
+ </listitem>
+ <listitem>
+ <simpara>
+ UDM_PARAM_CROSS_WORDS - enables or disables crosswords support.
+ Possible values: UDM_CROSS_WORDS_ENABLED and UDM_CROSS_WORDS_DISABLED.
+ </simpara>
+ <simpara>
+ The corsswords feature allows to assign words between <a href="xxx">
+and </a>
+ also to a document this link leads to. It works in SQL database mode and
+ is not supported in built-in database and Cachemode.
+ </simpara>
+ <note>
+ <simpara>
+ Crosswords are supported only in mnoGoSearch 3.1.11 or later.
+ </simpara>
+ </note>
+ </listitem>
+ </itemizedlist>
+ </refsect1>
</refentry>
- </reference>
+</reference>
+
<!-- Keep this comment at the end of the file
Local variables: