Delicious Bookmark this on Delicious Share on Facebook SlashdotSlashdot It! Digg! Digg



PHP : Function Reference : mnoGoSearch Functions : udm_alloc_agent

udm_alloc_agent

Allocate mnoGoSearch session (PHP 4 >= 4.0.5, PHP 5 <= 5.0.5, PECL mnogosearch:1.0.0)
resource udm_alloc_agent ( string dbaddr [, string dbmode] )

Allocate a mnoGoSearch session.

Parameters

dbaddr

dbaddr - URL-style database description, with options (type, host, database name, port, user and password) to connect to SQL database. Do not matter for built-in text files support. Format for dbaddr: DBType:[//[DBUser[:DBPass]@]DBHost[:DBPort]]/DBName/. Currently supported DBType values are: mysql, pgsql, msql, solid, mssql, oracle, and ibase. Actually, it does not matter for native libraries support, but ODBC users should specify one of the supported values. If your database type is not supported, you may use unknown instead.

dbmode

dbmode - You may select the SQL database mode of words storage. Possible values of dbmode are: single, multi, crc, or crc-multi. 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 the database. If "crc" mode is selected, mnoGoSearch will store 32 bit integer word IDs calculated by CRC32 algorithm instead of words. This mode requires 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 in "multi" mode.

Note:

dbaddr and dbmode must match those used during indexing.

Return Values

Returns a mnogosearch agent identifier on success, FALSE on failure. This function creates a session with database parameters.

Notes

Note:

In fact this function does not open a connection to the database and thus does not check the entered login and password. Establishing a connection to the database and login/password verification is done by udm_find().

Code Examples / Notes » udm_alloc_agent

cmv

For what it's worth, the following PHP code won't work:
<?  $U = udm_alloc_agent('mysql://localhost/example'); ?>
But this will:
<?  $U = udm_alloc_agent('mysql://localhost/example/'); ?>
That trailing slash is all-important.


Change Language


Follow Navioo On Twitter
udm_add_search_limit
udm_alloc_agent_array
udm_alloc_agent
udm_api_version
udm_cat_list
udm_cat_path
udm_check_charset
udm_check_stored
udm_clear_search_limits
udm_close_stored
udm_crc32
udm_errno
udm_error
udm_find
udm_free_agent
udm_free_ispell_data
udm_free_res
udm_get_doc_count
udm_get_res_field
udm_get_res_param
udm_hash32
udm_load_ispell_data
udm_open_stored
udm_set_agent_param
eXTReMe Tracker