diff --git "a/C:\\Users\\mlink\\AppData\\Local\\Temp\\TortoiseGit\\IndCC3E.tmp\\IndexSearchRepository-a5bec24-left.php" "b/D:\\git\\TYPO3.CMS-62\\typo3\\sysext\\indexed_search\\Classes\\Domain\\Repository\\IndexSearchRepository.php" index fc763de..743b351 100644 --- "a/C:\\Users\\mlink\\AppData\\Local\\Temp\\TortoiseGit\\IndCC3E.tmp\\IndexSearchRepository-a5bec24-left.php" +++ "b/D:\\git\\TYPO3.CMS-62\\typo3\\sysext\\indexed_search\\Classes\\Domain\\Repository\\IndexSearchRepository.php" @@ -257,6 +257,7 @@ class IndexSearchRepository { $c = 0; // This array accumulates the phash-values $totalHashList = array(); + $this->wSelClauses = array(); // Traverse searchwords; for each, select all phash integers and merge/diff/intersect them with previous word (based on operator) foreach ($searchWords as $k => $v) { // Making the query for a single search word based on the search-type @@ -310,8 +311,6 @@ class IndexSearchRepository { // Distinct word $res = $this->searchDistinct($sWord); } - // Accumulate the word-select clauses - $this->wSelClauses[] = $wSel; // If there was a query to do, then select all phash-integers which resulted from this. if ($res) { // Get phash list by searching for it: @@ -372,6 +371,7 @@ class IndexSearchRepository { $wildcard_left = $mode & self::WILDCARD_LEFT ? '%' : ''; $wildcard_right = $mode & self::WILDCARD_RIGHT ? '%' : ''; $wSel = 'IW.baseword LIKE \'' . $wildcard_left . $GLOBALS['TYPO3_DB']->quoteStr($sWord, 'index_words') . $wildcard_right . '\''; + $this->wSelClauses[] = $wSel; $res = $this->execPHashListQuery($wSel, ' AND is_stopword=0'); return $res; } @@ -384,6 +384,7 @@ class IndexSearchRepository { */ protected function searchDistinct($sWord) { $wSel = 'IW.wid=' . $this->md5inthash($sWord); + $this->wSelClauses[] = $wSel; $res = $this->execPHashListQuery($wSel, ' AND is_stopword=0'); return $res; } @@ -398,6 +399,7 @@ class IndexSearchRepository { $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery('ISEC.phash', 'index_section ISEC, index_fulltext IFT', 'IFT.fulltextdata LIKE \'%' . $GLOBALS['TYPO3_DB']->quoteStr($sWord, 'index_fulltext') . '%\' AND ISEC.phash = IFT.phash ' . $this->sectionTableWhere(), 'ISEC.phash'); + $this->wSelClauses[] = '1=1'; return $res; } @@ -409,6 +411,7 @@ class IndexSearchRepository { */ protected function searchMetaphone($sWord) { $wSel = 'IW.metaphone=' . $sWord; + $this->wSelClauses[] = $wSel; $res = $this->execPHashListQuery($wSel, ' AND is_stopword=0'); }