本文整理匯總了PHP中SearchEngine::SearchByQueryString方法的典型用法代碼示例。如果您正苦於以下問題:PHP SearchEngine::SearchByQueryString方法的具體用法?PHP SearchEngine::SearchByQueryString怎麽用?PHP SearchEngine::SearchByQueryString使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類SearchEngine
的用法示例。
在下文中一共展示了SearchEngine::SearchByQueryString方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: Fire
public function Fire()
{
if ($this->input->do == 'search') {
$search = new SearchEngine();
$results = $search->SearchByQueryString($this->input->query_string);
$hits = array();
$id_list = array();
foreach ($results as $result) {
$hits[$result->bug_id] = $result;
$id_list[] = $result->bug_id;
}
if (count($id_list) < 1) {
return;
}
$bugs = Bugdar::$db->Query("\n SELECT bugs.*, users.alias as reporting_alias\n FROM " . TABLE_PREFIX . "bugs bugs\n LEFT JOIN " . TABLE_PREFIX . "users users\n ON (bugs.reporting_user_id = users.user_id)\n WHERE bugs.bug_id IN (" . implode(',', $id_list) . ")\n LIMIT 30\n ");
while ($bug = $bugs->FetchObject()) {
$lucene_hit = $hits[$bug->bug_id];
$hits[$bug->bug_id] = $bug;
$hits[$bug->bug_id]->lucene_hit = $lucene_hit;
$hits[$bug->bug_id]->score = $lucene_hit->score;
}
$this->hits = $hits;
}
}