本文整理匯總了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();";
}