Actions
Bug #18599
closedTable table index_rel: don't write stopwords into
Status:
Closed
Priority:
Should have
Assignee:
-
Category:
Indexed Search
Target version:
-
Start date:
2008-04-10
Due date:
% Done:
100%
Estimated time:
TYPO3 Version:
4.1
PHP Version:
Tags:
Complexity:
Is Regression:
No
Sprint Focus:
Description
The table index_rel can grows to enormous size and the performance of searchqueries slow down. I think it is not necessary to write stopwords into the table.
function submitWords($wl,$phash) {
$stopwords = array();
$res = $GLOBALS['TYPO3_DB']->exec_SELECTquery('wid', 'index_words', 'is_stopword != 0');
while($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) {
$stopwords[$row['wid']] = 1;
}
$GLOBALS['TYPO3_DB']->exec_DELETEquery('index_rel', 'phash='.intval($phash));
foreach($wl as $val) {
if(isset($stopwords[$val['hash']])) {
continue;
}
$insertFields = array(
'phash' => $phash,
'wid' => $val['hash'],
'count' => $val['count'],
'first' => $val['first'],
'freq' => $this->freqMap(($val['count']/$this->wordcount)),
'flags' => ($val['cmp'] & $this->flagBitMask)
);
$GLOBALS['TYPO3_DB']->exec_INSERTquery('index_rel', $insertFields);
}
}
(issue imported from #M8083)
Actions