本文整理汇总了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");