[TYPO3] indexed_search can congest MySQL server for long time

Jan Slusarczyk jan.slusarczyk at dobrestrony.pl
Sat Feb 24 15:16:11 CET 2007


> I'm having trouble with indexed_search. I'm using it on a site which
> has lots of text. The database is only about 350MB (a dump would be
> about 500MB) big but it takes ages to search for anything. If I search
> for one word that is rather prominent on the site, the search takes
> about 1 min! I have recreated my index which seems to help a bit but not
> much.

I've had the same problem on http://www.instytutksiazki.pl. My 
index_word table grew to more than 2 milions rows.

The only way to deal with it is using another search service. I've 
decided to use mnogoSearch. It is really fast (searches take seconds 
rather than minutes) and accurate. My biggest problem was with language 
and templates - the default ones really suck (old HTML, inconsistent 
coding, <font> declarations etc). It took me two days to launch a 
working configuration and I'm really happy with it.

I have three languages on this site and search must be customized to the 
proper language. I'm using the following way to integrate the search engine:

my tscript:


includeLibs.something = fileadmin/lib/funkcja2.php

[globalVar = TSFE:id = 78]
   temp.search = USER_INT
   temp.search.userFunc = user_szukanie
   temp.content < temp.search
[global]



funkcja2.php:

<?
function Parse_Get()
{
	$output = "";
	$i = 0;
	foreach ($_GET as $key => $value)
	{
		if ($i == 0)
		{
			$output .= "?";
		}
		else
		{
			$output .= "&amp;";
		}
		$output .= $key."=".urlencode($value);
		$i++;
	}
	return $output;
}

function user_szukanie($content, $conf)
{
	global $TSFE;
     $lang = strtolower($TSFE->config["config"]["language"]);
	if ($lang == "en") {
		$langsuffix = "en";
	} elseif ($lang == "de") {
		$langsuffix = "de";		
	} else {
		$langsuffix = "pl";		
	}
	$file = 
'http://www.instytutksiazki.pl/cgi-bin/search_01'.$langsuffix.'.cgi'.Parse_Get();
	$output = @join (@file ($file),"");
	return $output;
}
?>

I have three mnogo http configurations:
http://www.instytutksiazki.pl/cgi-bin/search_01pl.cgi
http://www.instytutksiazki.pl/cgi-bin/search_01en.cgi
http://www.instytutksiazki.pl/cgi-bin/search_01de.cgi

Each is customized to provide results only in one of the languages and 
is stripped of the html header and footer to fit in existing page (id=78).

As a side note I wonder if there's a better way to integrate the cgi 
than join(); Any help will be appreciated.

Cheers
Jan


More information about the TYPO3-english mailing list