Index: branches/5.3.x/core/units/helpers/search_helper.php =================================================================== diff -u -N -r15928 -r16395 --- branches/5.3.x/core/units/helpers/search_helper.php (.../search_helper.php) (revision 15928) +++ branches/5.3.x/core/units/helpers/search_helper.php (.../search_helper.php) (revision 16395) @@ -1,6 +1,6 @@ addFilter('includes_filter_h', $includes_or_filter_h, kDBList::HAVING_FILTER); $object->addFilter('excepts_filter_h', $excepts_and_filter_h, kDBList::HAVING_FILTER); } - } \ No newline at end of file + + /** + * Ensures empty search table + * + * @return void + */ + public function ensureEmptySearchTable() + { + $search_table = $this->getSearchTable(); + $this->Conn->Query('DROP TABLE IF EXISTS ' . $search_table); + $sql = 'CREATE TABLE ' . $search_table . ' ( + `Relevance` decimal(8,5) DEFAULT NULL, + `ItemId` int(11) NOT NULL DEFAULT 0, + `ResourceId` int(11) DEFAULT NULL, + `ItemType` int(1) NOT NULL DEFAULT 0, + `EdPick` tinyint(4) NOT NULL DEFAULT 0, + KEY `ResourceId` (`ResourceId`), + KEY `Relevance` (`Relevance`) + )'; + $this->Conn->Query($sql); + } + + /** + * Search table name + * + * @return string + */ + public function getSearchTable() + { + return TABLE_PREFIX . 'ses_' . $this->Application->GetSID() . '_' . TABLE_PREFIX . 'Search'; + } + + }