本文整理汇总了PHP中CSearch::ReIndexAll方法的典型用法代码示例。如果您正苦于以下问题:PHP CSearch::ReIndexAll方法的具体用法?PHP CSearch::ReIndexAll怎么用?PHP CSearch::ReIndexAll使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CSearch
的用法示例。
在下文中一共展示了CSearch::ReIndexAll方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: execute
/**
* {@inheritdoc}
*/
protected function execute(InputInterface $input, OutputInterface $output)
{
if (!Loader::includeModule('search')) {
throw new BitrixException('Search module is not installed');
}
$searchResult = array();
$bar = new ProgressBar($output, 0);
do {
$bar->display();
$searchResult = \CSearch::ReIndexAll($input->getOption('full'), static::UPDATE_TIME, $searchResult);
$bar->advance();
$bar->clear();
if (is_array($searchResult) && $searchResult['MODULE'] == 'main') {
list(, $path) = explode("|", $searchResult["ID"], 2);
$output->writeln("\r " . $path, OutputInterface::VERBOSITY_VERBOSE);
}
} while (is_array($searchResult));
$bar->finish();
$bar->clear();
$output->write("\r");
if (ModuleManager::isModuleInstalled('socialnetwork')) {
$output->writeln('<info>The Social Network module needs to be reindexed using the Social Network component in the public section of site.</info>');
}
$output->writeln(sprintf('<info>Reindexed</info> %d element%s.', $searchResult, $searchResult > 1 ? 's' : ''));
return 0;
}
示例2: CopyDirFiles
}
CopyDirFiles($path . $file, WIZARD_SITE_PATH . "/" . $file, $rewrite = true, $recursive = true, $delete_after_copy = false);
}
}
$p = str_replace("//", "/", WIZARD_ABSOLUTE_PATH . "/site/services/main/components/");
if (is_dir($p)) {
$dir = opendir($p);
while ($item = readdir($dir)) {
if ($item == ".." or $item == ".") {
continue;
}
CopyDirFiles($p . '/' . $item, $_SERVER['DOCUMENT_ROOT'] . '/bitrix/components/' . $item, $ReWrite = true, $Recursive = true);
}
closedir($dir);
}
CSearch::ReIndexAll(false, 0, array(WIZARD_SITE_ID, WIZARD_SITE_DIR));
WizardServices::PatchHtaccess(WIZARD_SITE_PATH);
WizardServices::ReplaceMacrosRecursive(WIZARD_SITE_PATH . "about/", array("SITE_DIR" => WIZARD_SITE_DIR));
WizardServices::ReplaceMacrosRecursive(WIZARD_SITE_PATH . "auth/", array("SITE_DIR" => WIZARD_SITE_DIR));
WizardServices::ReplaceMacrosRecursive(WIZARD_SITE_PATH . "blog/", array("SITE_DIR" => WIZARD_SITE_DIR));
WizardServices::ReplaceMacrosRecursive(WIZARD_SITE_PATH . "brands/", array("SITE_DIR" => WIZARD_SITE_DIR));
WizardServices::ReplaceMacrosRecursive(WIZARD_SITE_PATH . "catalog/", array("SITE_DIR" => WIZARD_SITE_DIR));
WizardServices::ReplaceMacrosRecursive(WIZARD_SITE_PATH . "favorites/", array("SITE_DIR" => WIZARD_SITE_DIR));
WizardServices::ReplaceMacrosRecursive(WIZARD_SITE_PATH . "login/", array("SITE_DIR" => WIZARD_SITE_DIR));
WizardServices::ReplaceMacrosRecursive(WIZARD_SITE_PATH . "news/", array("SITE_DIR" => WIZARD_SITE_DIR));
WizardServices::ReplaceMacrosRecursive(WIZARD_SITE_PATH . "personal/", array("SITE_DIR" => WIZARD_SITE_DIR));
WizardServices::ReplaceMacrosRecursive(WIZARD_SITE_PATH . "search/", array("SITE_DIR" => WIZARD_SITE_DIR));
CWizardUtil::ReplaceMacros(WIZARD_SITE_PATH . "_index.php", array("SITE_DIR" => WIZARD_SITE_DIR));
$arUrlRewrite = array();
if (file_exists(WIZARD_SITE_ROOT_PATH . "/urlrewrite.php")) {
include WIZARD_SITE_ROOT_PATH . "/urlrewrite.php";
示例3: foreach
COption::SetOptionString("search", "max_execution_time", $max_execution_time);
if (!$bFull) {
if (isset($_REQUEST["site_id"]) && $_REQUEST["site_id"] != "") {
$NS["SITE_ID"] = $_REQUEST["site_id"];
}
if (isset($_REQUEST["module_id"]) && $_REQUEST["module_id"] != "") {
$NS["MODULE_ID"] = $_REQUEST["module_id"];
}
}
}
//Check for expired session and set clear flag
//in order to not accidetialy clear search index
if ($bFull && $NS["CLEAR"] != "Y" && !check_bitrix_sessid()) {
$NS["CLEAR"] = "Y";
}
$res = CSearch::ReIndexAll($bFull, COption::GetOptionInt("search", "max_execution_time"), $NS, $_REQUEST["clear_suggest"] === "Y");
if (is_array($res)) {
$jsNS = CUtil::PhpToJSObject(array("NS" => $res));
$urlNS = "";
foreach ($res as $key => $value) {
$urlNS .= "&" . urlencode("NS[" . $key . "]") . "=" . urlencode($value);
}
if ($bFull) {
$urlNS .= "&Full=Y";
}
$path = "";
if ($res["MODULE"] === "main") {
list($site, $path) = explode("|", $res["ID"], 2);
if ($path) {
$path .= "<br>";
}
示例4: unset
<?php
if (!defined("B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED !== true) {
die;
}
if (!CModule::IncludeModule("search")) {
return;
}
if (COption::GetOptionString("search", "exclude_mask") == "") {
COption::SetOptionString("search", "exclude_mask", "/bitrix/*;/404.php;/upload/*");
}
if (WIZARD_SITE_ID != "") {
$NS["SITE_ID"] = WIZARD_SITE_ID;
}
if (!isset($_SESSION['SearchFirst'])) {
$NS = CSearch::ReIndexAll(false, 20, $NS);
} else {
$NS = CSearch::ReIndexAll(false, 20, $_SESSION['SearchNS']);
}
if (is_array($NS)) {
$this->repeatCurrentService = true;
$_SESSION['SearchNS'] = $NS;
$_SESSION['SearchFirst'] = 1;
} else {
unset($_SESSION['SearchNS']);
unset($_SESSION['SearchFirst']);
}