*/
public function submitWords($wordList, $phash) {
if (\TYPO3\CMS\IndexedSearch\Utility\IndexedSearchUtility::isTableUsed('index_rel')) {
+ $stopWords = $GLOBALS['TYPO3_DB']->exec_SELECTgetRows('wid', 'index_words', 'is_stopword != 0', '', '', '', 'wid');
+
$GLOBALS['TYPO3_DB']->exec_DELETEquery('index_rel', 'phash=' . (int)$phash);
+ $fields = array('phash', 'wid', 'count', 'first', 'freq', 'flags');
+ $rows = array();
foreach ($wordList as $val) {
- $insertFields = array(
- 'phash' => (int)$phash,
- 'wid' => (int)$val['hash'],
- 'count' => (int)$val['count'],
- 'first' => (int)$val['first'],
- 'freq' => $this->freqMap($val['count'] / $this->wordcount),
- 'flags' => $val['cmp'] & $this->flagBitMask
+ if (isset($stopWords[$val['hash']])) {
+ continue;
+ }
+ $rows[] = array(
+ (int)$phash,
+ (int)$val['hash'],
+ (int)$val['count'],
+ (int)$val['first'],
+ $this->freqMap($val['count'] / $this->wordcount),
+ $val['cmp'] & $this->flagBitMask
);
- $GLOBALS['TYPO3_DB']->exec_INSERTquery('index_rel', $insertFields);
}
+ $GLOBALS['TYPO3_DB']->exec_INSERTmultipleRows('index_rel', $fields, $rows);
}
}