本文整理匯總了PHP中CSearch::createClient方法的典型用法代碼示例。如果您正苦於以下問題:PHP CSearch::createClient方法的具體用法?PHP CSearch::createClient怎麽用?PHP CSearch::createClient使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類CSearch
的用法示例。
在下文中一共展示了CSearch::createClient方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: CSearch
<?php
/**
* $Id$
*
* @category Search
* @package Mediboard
* @author SARL OpenXtrem <dev@openxtrem.com>
* @license GNU General Public License, see http://www.gnu.org/licenses/gpl.html
* @link http://www.mediboard.org */
CCanDo::checkAdmin();
$names_types = CValue::get("types");
$error = "";
try {
$client_index = new CSearch();
//create a client
$client_index->createClient();
$index = $client_index->getIndex(CAppUI::conf("db std dbname"))->exists();
$client_index->updateIndex($index);
CAppUI::displayAjaxMsg("L'index " . CAppUI::conf("db std dbname") . " s'est correctement mis à jour", UI_MSG_OK);
} catch (Exception $e) {
CAppUI::displayAjaxMsg("L'index " . CAppUI::conf("db std dbname") . " n'a pas été mis à jour", UI_MSG_ERROR);
$error = "update";
}
$smarty = new CSmartyDP();
$smarty->assign("error", $error);
$smarty->display("inc_configure_es.tpl");
示例2: CSearch
<?php
/**
* $Id$
*
* @category search
* @package Mediboard
* @author SARL OpenXtrem <dev@openxtrem.com>
* @license GNU General Public License, see http://www.gnu.org/licenses/gpl.html
* @link http://www.mediboard.org */
CCanDo::checkAdmin();
$error = "";
$search = new CSearch();
$search->createClient();
$settings["settings"] = CSearch::$settings_default;
$settings["settings"]["number_of_replicas"] = CAppUI::conf("search nb_replicas");
$types = "";
$group = CGroups::loadCurrent();
if (CAppUI::conf("search active_handler active_handler_search_types", $group)) {
$types = explode("|", CAppUI::conf("search active_handler active_handler_search_types", $group));
}
$mapping = CSearch::$mapping_default;
$final_mapping = array();
$final_mapping["properties"] = $mapping;
// Création du template
$smarty = new CSmartyDP();
$smarty->assign("error", $error);
$smarty->assign("settings", json_encode($settings));
$smarty->assign("types", $types);
$smarty->assign("mapping", json_encode($final_mapping));
$smarty->display("inc_configure_reindexing.tpl");