Firstly, this problem has no way degrading the performance of Joomla! as PHP/MySQL doesn't work harder.
Second, I think I have a short solution. Modification of components/com_search/search.php:
At about line 74, after
Code:
$searchword = strval( mosGetParam( $_REQUEST, 'searchword', '' ) );
add
Code:
$searchword = preg_replace('/[\s\.\\\+\*\?\[\^\]\$\(\)\{\}\=\!\<\>\|]+/', ' ', $searchword);
At about line 185, replace
Code:
foreach ($searchwords as $hlword) {
$text = preg_replace( '/' . preg_quote( $hlword, '/' ) . '/i', '<span class="highlight">\0</span>', $text );
}
with
Code:
$text = preg_replace('!(' . implode($searchwords, '|') . ')!i', '<span class="highlight">\1</span>', $text);
The first one remove dirty space (which returns indesirable results), the second avoid looped "
It works for me (
http://thongtincongnghe.com).
The com_search of Joomla is far from perfection.