本文整理汇总了PHP中CSearch::queryByType方法的典型用法代码示例。如果您正苦于以下问题:PHP CSearch::queryByType方法的具体用法?PHP CSearch::queryByType怎么用?PHP CSearch::queryByType使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CSearch
的用法示例。
在下文中一共展示了CSearch::queryByType方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: CSearchLog
$client_index = new CSearchLog();
$client_index->createClient();
$client_index->loadIndex($client_index->loadNameIndex());
$date = CMbDT::format($date, "%Y/%m/%d");
$words .= "date:[" . $date . " TO " . "{$date}] user_id:(" . $user_id . ")";
$agregation = array();
$tabActive = "";
if (!$types) {
$types = $client_index->loadContextes();
}
} else {
$client_index = new CSearch();
$client_index->createClient();
$client_index->loadIndex();
$words .= " object_ref_class:" . $object_ref_class . " " . "object_ref_id:" . $object_ref_id;
$results = $client_index->queryByType($words, null, $types);
$agregation = $results->getAggregation("ref_type");
$tabActive = $agregation["buckets"][0]["key"];
}
try {
$results = $client_index->queryByType($words, $client_index->_index->getName(), $types);
$agregation = $results->getAggregation("ref_type");
$tabActive = $agregation["buckets"][0]["key"];
} catch (Exception $e) {
CAppUI::displayAjaxMsg("Problème à la récupération des données", UI_MSG_ERROR);
}
$smarty = new CSmartyDP();
$smarty->assign("agregation", $agregation["buckets"]);
$smarty->assign("date", $date);
$smarty->assign("user_id", $user_id);
$smarty->assign("object_ref_class", $object_ref_class);