#18599Table table index_rel: don't write stopwords into
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)