当前位置: 首页>>代码示例>>PHP>>正文


PHP CSearch::CleanFreqCache方法代码示例

本文整理汇总了PHP中CSearch::CleanFreqCache方法的典型用法代码示例。如果您正苦于以下问题:PHP CSearch::CleanFreqCache方法的具体用法?PHP CSearch::CleanFreqCache怎么用?PHP CSearch::CleanFreqCache使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CSearch的用法示例。


在下文中一共展示了CSearch::CleanFreqCache方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: replace

 public function replace($ID, $arFields)
 {
     $DB = CDatabase::GetModuleConnection('search');
     if (array_key_exists("SEARCHABLE_CONTENT", $arFields)) {
         if (BX_SEARCH_VERSION > 1) {
             $text_md5 = md5($arFields["SEARCHABLE_CONTENT"]);
             $rsText = $DB->Query("SELECT SEARCH_CONTENT_MD5 FROM b_search_content_text WHERE SEARCH_CONTENT_ID = " . $ID);
             $arText = $rsText->Fetch();
             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") {
                     CSearchStemTable::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") {
                 CSearchStemTable::DelayStemIndex($ID);
             } else {
                 CSearch::StemIndex($arFields["SITE_ID"], $ID, $arFields["SEARCHABLE_CONTENT"]);
             }
         }
     }
 }
开发者ID:DarneoStudio,项目名称:bitrix,代码行数:31,代码来源:stemtable.php

示例2: Index


//.........这里部分代码省略.........
			foreach($arFields["PERMISSIONS"] as $group_id)
			{
				if(is_numeric($group_id))
					$arGroups[$group_id] = "G".intval($group_id);
				else
					$arGroups[$group_id] = $group_id;
			}
		}

		$strSqlSelect = "";
		if($bBody) $strSqlSelect .= ",BODY";
		if($bTitle) $strSqlSelect .= ",TITLE";
		if($bTags) $strSqlSelect .= ",TAGS";

		$strSql =
			"SELECT ID, MODULE_ID, ITEM_ID, ".$DB->DateToCharFunction("DATE_CHANGE")." as DATE_CHANGE
			".$strSqlSelect."
			FROM b_search_content
			WHERE MODULE_ID = '".$DB->ForSQL($MODULE_ID)."'
				AND ITEM_ID = '".$DB->ForSQL($ITEM_ID)."' ";

		$r = $DB->Query($strSql, false, "File: ".__FILE__."<br>Line: ".__LINE__);

		if($arResult = $r->Fetch())
		{
			$ID = $arResult["ID"];

			if($bTitle && $bBody && strlen($arFields["BODY"])<=0 && strlen($arFields["TITLE"])<=0)
			{
				foreach(GetModuleEvents("search", "OnBeforeIndexDelete", true) as $arEvent)
					ExecuteModuleEventEx($arEvent, array("SEARCH_CONTENT_ID = ".$ID));

				CSearchTags::CleanCache("", $ID);
				CSearch::CleanFreqCache($ID);
				$DB->Query("DELETE FROM b_search_content_param WHERE SEARCH_CONTENT_ID = ".$ID, false, "File: ".__FILE__."<br>Line: ".__LINE__);
				$DB->Query("DELETE FROM b_search_content_right WHERE SEARCH_CONTENT_ID = ".$ID, false, "File: ".__FILE__."<br>Line: ".__LINE__);
				$DB->Query("DELETE FROM b_search_content_site WHERE SEARCH_CONTENT_ID = ".$ID, false, "File: ".__FILE__."<br>Line: ".__LINE__);
				$DB->Query("DELETE FROM b_search_content_title WHERE SEARCH_CONTENT_ID = ".$ID, false, "File: ".__FILE__."<br>Line: ".__LINE__);
				$DB->Query("DELETE FROM b_search_tags WHERE SEARCH_CONTENT_ID = ".$ID, false, "File: ".__FILE__."<br>Line: ".__LINE__);
				$DB->Query("DELETE FROM b_search_content WHERE ID = ".$ID, false, "File: ".__FILE__."<br>Line: ".__LINE__);
				CSearchFullText::getInstance()->deleteById($ID);

				return 0;
			}

			if(is_set($arFields, "PARAMS"))
				CAllSearch::SetContentItemParams($ID, $arFields["PARAMS"]);

			if(count($arGroups) > 0)
				CAllSearch::SetContentItemGroups($ID, $arGroups);

			if(is_set($arFields, "SITE_ID"))
			{
				CSearch::UpdateSite($ID, $arFields["SITE_ID"]);
			}

			if(array_key_exists("LAST_MODIFIED", $arFields))
				$arFields["~DATE_CHANGE"] = $arFields["DATE_CHANGE"] = $DATE_CHANGE = $arFields["LAST_MODIFIED"];
			elseif(array_key_exists("DATE_CHANGE", $arFields))
				$arFields["~DATE_CHANGE"] = $arFields["DATE_CHANGE"] = $DATE_CHANGE = $DB->FormatDate($arFields["DATE_CHANGE"], "DD.MM.YYYY HH:MI:SS", CLang::GetDateFormat());
			else
				$DATE_CHANGE = '';

			if(!$bOverWrite && $DATE_CHANGE == $arResult["DATE_CHANGE"])
			{
				if(strlen($SEARCH_SESS_ID)>0)
开发者ID:nycmic,项目名称:bittest,代码行数:67,代码来源:search.php

示例3: Index


//.........这里部分代码省略.........
			foreach($arFields["PERMISSIONS"] as $group_id)
			{
				if(is_numeric($group_id))
					$arGroups[$group_id] = "G".intval($group_id);
				else
					$arGroups[$group_id] = $group_id;
			}
		}

		$strSqlSelect = "";
		if($bBody) $strSqlSelect .= ",BODY";
		if($bTitle) $strSqlSelect .= ",TITLE";
		if($bTags) $strSqlSelect .= ",TAGS";

		$strSql =
			"SELECT ID, ".$DB->DateToCharFunction("DATE_CHANGE")." as DATE_CHANGE
			".$strSqlSelect."
			FROM b_search_content
			WHERE MODULE_ID = '".$DB->ForSQL($MODULE_ID)."'
				AND ITEM_ID = '".$DB->ForSQL($ITEM_ID)."' ";

		$r = $DB->Query($strSql, false, "File: ".__FILE__."<br>Line: ".__LINE__);

		if($arResult = $r->Fetch())
		{
			$ID = $arResult["ID"];

			if($bTitle && $bBody && strlen($arFields["BODY"])<=0 && strlen($arFields["TITLE"])<=0)
			{
				foreach(GetModuleEvents("search", "OnBeforeIndexDelete", true) as $arEvent)
					ExecuteModuleEventEx($arEvent, array("SEARCH_CONTENT_ID = ".$ID));

				CSearchTags::CleanCache("", $ID);
				CSearch::CleanFreqCache($ID);
				$DB->Query("DELETE FROM b_search_content_param WHERE SEARCH_CONTENT_ID = ".$ID, false, "File: ".__FILE__."<br>Line: ".__LINE__);
				$DB->Query("DELETE FROM b_search_content_right WHERE SEARCH_CONTENT_ID = ".$ID, false, "File: ".__FILE__."<br>Line: ".__LINE__);
				$DB->Query("DELETE FROM b_search_content_site WHERE SEARCH_CONTENT_ID = ".$ID, false, "File: ".__FILE__."<br>Line: ".__LINE__);
				$DB->Query("DELETE FROM b_search_content_title WHERE SEARCH_CONTENT_ID = ".$ID, false, "File: ".__FILE__."<br>Line: ".__LINE__);
				$DB->Query("DELETE FROM b_search_content_stem WHERE SEARCH_CONTENT_ID = ".$ID, false, "File: ".__FILE__."<br>Line: ".__LINE__);
				if(BX_SEARCH_VERSION > 1)
					$DB->Query("DELETE FROM b_search_content_text WHERE SEARCH_CONTENT_ID = ".$ID, false, "File: ".__FILE__."<br>Line: ".__LINE__);
				$DB->Query("DELETE FROM b_search_tags WHERE SEARCH_CONTENT_ID = ".$ID, false, "File: ".__FILE__."<br>Line: ".__LINE__);
				$DB->Query("DELETE FROM b_search_content WHERE ID = ".$ID, false, "File: ".__FILE__."<br>Line: ".__LINE__);

				return 0;
			}

			if(is_set($arFields, "PARAMS"))
				CAllSearch::SetContentItemParams($ID, $arFields["PARAMS"]);

			if(count($arGroups) > 0)
				CAllSearch::SetContentItemGroups($ID, $arGroups);

			if(is_set($arFields, "SITE_ID"))
			{
				$arSITE_ID = $arFields["SITE_ID"];
				$strSql = "
					SELECT SITE_ID, URL
					FROM b_search_content_site
					WHERE SEARCH_CONTENT_ID = ".$ID."
				";
				$rsSite = $DB->Query($strSql, false, "File: ".__FILE__."<br>Line: ".__LINE__);
				while($arSite = $rsSite->Fetch())
				{
					if(array_key_exists($arSite["SITE_ID"], $arSITE_ID))
					{
开发者ID:nProfessor,项目名称:Mytb,代码行数:67,代码来源:search.php


注:本文中的CSearch::CleanFreqCache方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。