[TYPO3-dev] indexed search and Mysql FULL TEXT index
Dmitry Dulepov [typo3]
dmitry at typo3.org
Sat Mar 1 10:08:13 CET 2008
Hi!
Martin Kutschker wrote:
> * Ideally the indexed search would be able to determine if it's tables
> are stored in a Mysql server.
I have code example for it. It is for tt_news but easy to adopt to anything else. Here it is:
=======================
$useFTS = false;
if (gettype($GLOBALS['TYPO3_DB']->link) == 'mysql resource') {
// See if can use FTS
$res = $GLOBALS['TYPO3_DB']->sql_query('SHOW CREATE TABLE tt_news');
$row = $GLOBALS['TYPO3_DB']->sql_fetch_row($res);
$GLOBALS['TYPO3_DB']->sql_free_result($res);
$createInfo = strtolower($row[1]);
$useFTS = (strpos($createInfo, 'engine=myisam') && strpos($createInfo, 'fulltext'));
}
if ($useFTS) {
// Rebuild query completely
$where = ' AND MATCH(title,bodytext) AGAINST (' .
$GLOBALS['TYPO3_DB']->fullQuoteStr($sw) . ' IN BOOLEAN MODE)';
}
=======================
I doubt it would help much. Many indexed search performance problems come from how it indexes, not only from how it searches.
--
Dmitry Dulepov
TYPO3 core team
Web: http://typo3bloke.net/
Skype: callto:liels_bugs
"Nothing is impossible. There are only limits to our knowledge"
More information about the TYPO3-dev
mailing list