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



PHP : Function Reference : mnoGoSearch Functions : udm_set_agent_param

udm_set_agent_param

Set mnoGoSearch agent session parameters (PHP 4 >= 4.0.5, PHP 5 <= 5.0.5, PECL mnogosearch:1.0.0)
bool udm_set_agent_param ( resource agent, int var, string val )


Code Examples / Notes » udm_set_agent_param

ywarnier

Other possible session parameters not documented but found in the default php frontend on http://www.mnogosearch.org:
UDM_PARAM_BROWSER_CHARSET - ?
UDM_PARAM_HLBEG - defines the tag to use before an highlighted search term
UDM_PARAM_HLBEG  - defines the tag to use after an highlighted search term
UDM_PARAM_QSTRING - defines the search term (or query string)
UDM_PARAM_REMOTE_ADDR - ?
UDM_PARAM_QUERY - ?
UDM_PARAM_STORED - ?
UDM_PARAM_GROUPBYSITE - toggles the "group by site" feature (UDM_ENABLED or UDM_DISABLED)
UDM_PARAM_SITEID - ?
UDM_PARAM_DETECT_CLONES - enable the "detect clone" feature (UDM_ENABLED or UDM_DISABLED)


gneraltsao

One useful parameter not documented above is UDM_PARAM_SYNONYM.  If you understand how this API works in general, you should be able to figure it out, but here goes anyway:
<?php
/* Make sure that PHP is able to find the file.  Unlike mnogosearch's indexer and search.cgi, it doesn't know the directory of the installation. */
$synFile="/usr/local/mnogosearch/etc/synonym/english.syn";
udm_set_agent_param($agent, UDM_PARAM_SYNONYM, $synFile);
?>
Piece of cake.
For more about mnogosearch's handling of synonyms see http://www.mnogosearch.org/doc/msearch-fuzzy.html#synonyms


adu

I found an undocumented function: udm_set_agent_param_ex
For example, if you want to sort results by date, do this:
udm_set_agent_param_ex($udm_agent, 's', 'DR');
See http://www.mnogosearch.org/doc/msearch-doingsearch.html for details


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