epic fix of search index building
This commit is contained in:
@@ -2707,10 +2707,10 @@ class SearchEngine extends PhpObject
|
|||||||
$sWords = implode(self::KEYWORDS_SEPARATOR, $asWords);
|
$sWords = implode(self::KEYWORDS_SEPARATOR, $asWords);
|
||||||
$sWords = mb_strtolower(str_replace("\n", self::KEYWORDS_SEPARATOR, $sWords));
|
$sWords = mb_strtolower(str_replace("\n", self::KEYWORDS_SEPARATOR, $sWords));
|
||||||
//TODO Fix char encoding
|
//TODO Fix char encoding
|
||||||
$sWords = preg_replace('/(\W+)/', self::KEYWORDS_SEPARATOR, $sWords); //remove all non-word characters
|
$sWords = preg_replace('/(\W+)/u', self::KEYWORDS_SEPARATOR, $sWords); //remove all non-word characters
|
||||||
|
|
||||||
//Add / Modify search database
|
//Add / Modify search database
|
||||||
$asData = array('id_item'=>$iItemId, 'type'=>$sType, 'refer_id'=>$asItemData['refer_id'], 'keywords'=>$sWords);
|
$asData = array('id_item'=>$iItemId, 'type'=>$sType, 'refer_id'=>(array_key_exists('refer_id', $asItemData)?$asItemData['refer_id']:0), 'keywords'=>$sWords);
|
||||||
$this->oMySql->insertUpdateRow(MySqlManager::SEARCH_TABLE, $asData, array('id_item', 'type'));
|
$this->oMySql->insertUpdateRow(MySqlManager::SEARCH_TABLE, $asData, array('id_item', 'type'));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user