本文整理汇总了PHP中CSearch::TagsIndex方法的典型用法代码示例。如果您正苦于以下问题:PHP CSearch::TagsIndex方法的具体用法?PHP CSearch::TagsIndex怎么用?PHP CSearch::TagsIndex使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CSearch
的用法示例。
在下文中一共展示了CSearch::TagsIndex方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: Index
//.........这里部分代码省略.........
}
if($bBody)
$content .= $arFields["BODY"]."\r\n";
else
$content .= $arResult["BODY"]."\r\n";
if($bTags)
$content .= $arFields["TAGS"];
else
$content .= $arResult["TAGS"];
$content = preg_replace_callback("/&#(\\d+);/", array("CSearch", "chr"), $content);
$arFields["SEARCHABLE_CONTENT"] = CSearch::KillEntities(ToUpper($content));
}
if(strlen($SEARCH_SESS_ID)>0)
$arFields["UPD"] = $SEARCH_SESS_ID;
if(array_key_exists("TITLE", $arFields))
{
$DB->Query("DELETE FROM b_search_content_title WHERE SEARCH_CONTENT_ID = ".$ID, false, "File: ".__FILE__."<br>Line: ".__LINE__);
if(
!array_key_exists("INDEX_TITLE", $arFields)
|| $arFields["INDEX_TITLE"] !== false
)
CSearch::IndexTitle($arFields["SITE_ID"], $ID, $arFields["TITLE"]);
}
if($bTags && ($arResult["TAGS"] != $arFields["TAGS"]))
{
CSearchTags::CleanCache("", $ID);
$DB->Query("DELETE FROM b_search_tags WHERE SEARCH_CONTENT_ID = ".$ID, false, "File: ".__FILE__."<br>Line: ".__LINE__);
CSearch::TagsIndex($arFields["SITE_ID"], $ID, $arFields["TAGS"]);
}
foreach(GetModuleEvents("search", "OnBeforeIndexUpdate", true) as $arEvent)
ExecuteModuleEventEx($arEvent, array($ID, $arFields));
CSearch::Update($ID, $arFields);
$arFields["MODULE_ID"] = $arResult['MODULE_ID'];
$arFields["ITEM_ID"] = $arResult['ITEM_ID'];
CSearchFullText::getInstance()->replace($ID, $arFields);
}
else
{
if($bTitle && $bBody && strlen($arFields["BODY"])<=0 && strlen($arFields["TITLE"])<=0)
{
//$DB->Commit();
return 0;
}
$arFields["MODULE_ID"] = $MODULE_ID;
$arFields["ITEM_ID"] = $ITEM_ID;
if(array_key_exists("INDEX_TITLE", $arFields) && $arFields["INDEX_TITLE"] === false)
$content = $arFields["BODY"]."\r\n".$arFields["TAGS"];
else
$content = $arFields["TITLE"]."\r\n".$arFields["BODY"]."\r\n".$arFields["TAGS"];
$content = preg_replace_callback("/&#(\\d+);/", array("CSearch", "chr"), $content);
$arFields["SEARCHABLE_CONTENT"] = CSearch::KillEntities(ToUpper($content));
if($SEARCH_SESS_ID!="")
$arFields["UPD"] = $SEARCH_SESS_ID;
示例2: Index
//.........这里部分代码省略.........
if(!$arText || $arText["SEARCH_CONTENT_MD5"] !== $text_md5)
{
CSearch::CleanFreqCache($ID);
$DB->Query("DELETE FROM b_search_content_stem WHERE SEARCH_CONTENT_ID = ".$ID, false, "File: ".__FILE__."<br>Line: ".__LINE__);
if (COption::GetOptionString("search", "agent_stemming") === "Y")
CSearch::DelayStemIndex($ID);
else
CSearch::StemIndex($arFields["SITE_ID"], $ID, $arFields["SEARCHABLE_CONTENT"]);
$DB->Query("DELETE FROM b_search_content_text WHERE SEARCH_CONTENT_ID = ".$ID, false, "File: ".__FILE__."<br>Line: ".__LINE__);
$arText = array(
"ID" => 1,
"SEARCH_CONTENT_ID" => $ID,
"SEARCH_CONTENT_MD5" => $text_md5,
"SEARCHABLE_CONTENT" => $arFields["SEARCHABLE_CONTENT"]
);
$DB->Add("b_search_content_text", $arText, Array("SEARCHABLE_CONTENT"));
}
}
else
{
CSearch::CleanFreqCache($ID);
$DB->Query("DELETE FROM b_search_content_stem WHERE SEARCH_CONTENT_ID = ".$ID, false, "File: ".__FILE__."<br>Line: ".__LINE__);
if (COption::GetOptionString("search", "agent_stemming") === "Y")
CSearch::DelayStemIndex($ID);
else
CSearch::StemIndex($arFields["SITE_ID"], $ID, $arFields["SEARCHABLE_CONTENT"]);
}
}
if($bTags && ($arResult["TAGS"] != $arFields["TAGS"]))
{
CSearchTags::CleanCache("", $ID);
$DB->Query("DELETE FROM b_search_tags WHERE SEARCH_CONTENT_ID = ".$ID, false, "File: ".__FILE__."<br>Line: ".__LINE__);
CSearch::TagsIndex($arFields["SITE_ID"], $ID, $arFields["TAGS"]);
}
foreach(GetModuleEvents("search", "OnBeforeIndexUpdate", true) as $arEvent)
ExecuteModuleEventEx($arEvent, array($ID, $arFields));
CSearch::Update($ID, $arFields);
}
else
{
if($bTitle && $bBody && strlen($arFields["BODY"])<=0 && strlen($arFields["TITLE"])<=0)
{
//$DB->Commit();
return 0;
}
$arFields["MODULE_ID"] = $MODULE_ID;
$arFields["ITEM_ID"] = $ITEM_ID;
if(array_key_exists("INDEX_TITLE", $arFields) && $arFields["INDEX_TITLE"] === false)
$content = $arFields["BODY"]."\r\n".$arFields["TAGS"];
else
$content = $arFields["TITLE"]."\r\n".$arFields["BODY"]."\r\n".$arFields["TAGS"];
$content = preg_replace ("'&#(\d+);'e", "chr(\\1)", $content);
$arFields["SEARCHABLE_CONTENT"] = CSearch::KillEntities(ToUpper($content));
if($SEARCH_SESS_ID!="")
$arFields["UPD"] = $SEARCH_SESS_ID;
$ID = CSearch::Add($arFields);
foreach(GetModuleEvents("search", "OnAfterIndexAdd", true) as $arEvent)