本文整理汇总了PHP中search::check_index方法的典型用法代码示例。如果您正苦于以下问题:PHP search::check_index方法的具体用法?PHP search::check_index怎么用?PHP search::check_index使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类search
的用法示例。
在下文中一共展示了search::check_index方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: activate
static function activate() {
// Update the root item. This is a quick hack because the search module is activated as part
// of the official install, so this way we don't start off with a "your index is out of date"
// banner.
search::update(model_cache::get("item", 1));
search::check_index();
}
示例2: install
static function install()
{
$version = module::get_version("search");
$db = Database::instance();
if ($version == 0) {
$db->query("CREATE TABLE `search_records` (\n `id` int(9) NOT NULL auto_increment,\n `item_id` int(9),\n `dirty` boolean default 1,\n `data` LONGTEXT default NULL,\n PRIMARY KEY (`id`),\n FULLTEXT INDEX (`data`))\n ENGINE=MyISAM DEFAULT CHARSET=utf8;");
// populate the index with dirty records
$db->query("insert into `search_records` (`item_id`) SELECT `id` FROM `items`");
module::set_version("search", 1);
if (ORM::factory("search_record")->count_all() < 10) {
foreach (ORM::factory("search_record")->where("dirty", 1)->find_all() as $record) {
search::update_record($record);
}
} else {
search::check_index();
}
}
}