php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #57144 Unable to customize UDM_PARAM_HLBEG or UDM_PARAM_HLEND
Submitted: 2006-07-17 05:45 UTC Modified: 2017-01-29 04:22 UTC
Votes:1
Avg. Score:3.0 ± 0.0
Reproduced:0 of 0 (0.0%)
From: pioneer at daweb dot net Assigned:
Status: No Feedback Package: mnogosearch (PECL)
PHP Version: 5.1.2 OS: FreeBSD 4.x
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [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)

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2006-07-17 06:09 UTC] gluke at mail dot ru
This is not a bug. Or, at least, not a mnogosearch extension bug. Those square blocks are search words margins. The PEAR code should replace those blocks with highlighting tags you entered, but it does not. Ask mnogosearch PEAR module author for comments, please.
 [2006-07-17 06:27 UTC] pioneer at daweb dot net
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.
 [2006-07-18 04:11 UTC] pioneer at daweb dot net
Forgot to change the status back to 'Open'; I don't think this is anything to do with PHP script error.  The two highlight parameters are definitely being set prior to running a find.
 [2017-01-20 21:04 UTC] heiglandreas@php.net
-Status: Open +Status: Feedback
 [2017-01-20 21:04 UTC] heiglandreas@php.net
Is this still relevant?
 [2017-01-29 04:22 UTC] pecl-dev at lists dot php dot net
No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to "Re-Opened". Thank you.
 
PHP Copyright © 2001-2020 The PHP Group
All rights reserved.
Last updated: Mon Nov 23 20:01:23 2020 UTC