本文整理匯總了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);