[TYPO3-english] mnogosearch and substring search

Hauke Meyer meyer at visionconnect.de
Mon Apr 6 17:00:08 CEST 2009


Hi folks,

I tried to figure out how I can activate substring search using the
mnogosearch extension from outside. But it is hard coded inside the
extension. Here is my patch and I want to ask Dmitry if he can put this
inside the trunk:


###

replace:

Udm_Set_Agent_Param($udmAgent, UDM_PARAM_WORD_MATCH, UDM_MATCH_WORD);

###

with:
$match_type = UDM_MATCH_WORD;
if (isset($this->piVars['wm']))
{
	switch ($this->piVars['wm'])
	{
		case 'sub':
			$match_type = UDM_MATCH_SUBSTR;
			break;	
		case 'begin':
			$match_type = UDM_MATCH_BEGIN;
			break;	
		case 'end':
			$match_type = UDM_MATCH_END;
			break;				
	}				
}	
Udm_Set_Agent_Param($udmAgent, UDM_PARAM_WORD_MATCH, $match_type);

###

Now you can change the search behavior with a simple hidden formfield like

<input type="hidden" name="tx_mnogosearch_pi1[wm]" value="sub" />

in order to activate the substring ability from mnogosearch.


thanks.

Hauke



More information about the TYPO3-english mailing list