Project

General

Profile

Bug #67843 ยป indexed_search_wSelClauses.patch

Manuel Link, 2015-06-30 22:46

View differences:

"b/D:\\git\\TYPO3.CMS-62\\typo3\\sysext\\indexed_search\\Classes\\Domain\\Repository\\IndexSearchRepository.php"
$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
......
// 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:
......
$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;
}
......
*/
protected function searchDistinct($sWord) {
$wSel = 'IW.wid=' . $this->md5inthash($sWord);
$this->wSelClauses[] = $wSel;
$res = $this->execPHashListQuery($wSel, ' AND is_stopword=0');
return $res;
}
......
$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;
}
......
*/
protected function searchMetaphone($sWord) {
$wSel = 'IW.metaphone=' . $sWord;
$this->wSelClauses[] = $wSel;
$res = $this->execPHashListQuery($wSel, ' AND is_stopword=0');
}
    (1-1/1)