本文整理汇总了PHP中CSearch::StemIndex方法的典型用法代码示例。如果您正苦于以下问题:PHP CSearch::StemIndex方法的具体用法?PHP CSearch::StemIndex怎么用?PHP CSearch::StemIndex使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CSearch
的用法示例。
在下文中一共展示了CSearch::StemIndex方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: DelayedStemIndex
function DelayedStemIndex()
{
$DB = CDatabase::GetModuleConnection('search');
$etime = time() + intval(COption::GetOptionString("search", "agent_duration"));
do {
$stemQueue = $DB->Query($DB->TopSql("\n\t\t\t\tSELECT SEARCH_CONTENT_ID ID\n\t\t\t\tFROM b_search_content_stem\n\t\t\t\tWHERE SEARCH_CONTENT_ID < 0\n\t\t\t", 1));
if ($stemTask = $stemQueue->Fetch()) {
$ID = -$stemTask["ID"];
$sites = array();
$rsSite = $DB->Query("\n\t\t\t\t\tSELECT SITE_ID, URL\n\t\t\t\t\tFROM b_search_content_site\n\t\t\t\t\tWHERE SEARCH_CONTENT_ID = " . $ID . "\n\t\t\t\t");
while ($arSite = $rsSite->Fetch()) {
$sites[$arSite["SITE_ID"]] = $arSite["URL"];
}
if (BX_SEARCH_VERSION > 1) {
$sql = "SELECT SEARCHABLE_CONTENT from b_search_content_text WHERE SEARCH_CONTENT_ID = {$ID}";
} else {
$sql = "SELECT SEARCHABLE_CONTENT from b_search_content WHERE ID = {$ID}";
}
$rsContent = $DB->Query($sql);
if ($arContent = $rsContent->Fetch()) {
$DB->Query("DELETE FROM b_search_content_stem WHERE SEARCH_CONTENT_ID = " . $ID);
CSearch::StemIndex($sites, $ID, $arContent["SEARCHABLE_CONTENT"]);
}
$DB->Query("DELETE FROM b_search_content_stem WHERE SEARCH_CONTENT_ID = " . $stemTask["ID"]);
} else {
//Cancel the agent
return "";
}
} while ($etime >= time());
return "CSearchStemTable::DelayedStemIndex();";
}