|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2006-07-17 05:45 UTC] pioneer at daweb dot net
Description: ------------ I have been unable to customize the values of UDM_PARAM_HLBEG and UDM_PARAM_HLEND, which are used to highlight the search term within a page search extract. I tried using the alpha version of PEAR Search_Mnogosearch and also manually building a search using the functions in your PECL module. Whenever I try and override the default values, the search term is displayed between strange white-square characters. You can see the problem at the following test URL: http://www.superhaggis.com/search2.php?q=develop Reproduce code: --------------- Manual functions: ... udm_set_agent_param($connection, UDM_PARAM_HLBEG, '<i>'); udm_set_agent_param($connection, UDM_PARAM_HLEND, '</i>'); ... PEAR Search_Mnogosearch: ... $search =& Search_Mnogosearch::connect('mysql://user:pass@localhost/searchdb/?dbmode=multi'); $search->setParameter(UDM_PARAM_HLBEG, '<i>'); $search->setParameter(UDM_PARAM_HLEND, '</i>'); $result =& $search->query($q); ... Expected result: ---------------- ... <i>develop</i> ... Actual result: -------------- ... develop ... (non-character square block either side of keyword) PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sun Nov 02 01:00:02 2025 UTC |
Thanks for your speedy response! I don't think this problem is PEAR mnogosearch specific. As I said, I also tried searching manually using the function calls. $q = trim($_GET['q']); $connection = udm_alloc_agent('mysql://user:pass@localhost/searchdb/?dbmode=multi'); udm_set_agent_param($connection, UDM_PARAM_HLBEG, '<i>'); udm_set_agent_param($connection, UDM_PARAM_HLEND, '</i>'); $result = udm_find($connection, $q); $totalMatches = udm_get_res_param($result, UDM_PARAM_FOUND); $pageSize = udm_get_res_param($result, UDM_PARAM_NUM_ROWS); $firstRow = udm_get_res_param($result, UDM_PARAM_FIRST_DOC); $lastRow = udm_get_res_param($result, UDM_PARAM_LAST_DOC); ... I still end up with the same problem.