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