&$row) { switch ($row['type']) { case 'People': $page = Qs_SiteMap::findFirst(array(), array('type' => 'People_', 'idGroup' => 1)); $row['url'] = $page['url'] . '/' . $row['id']; break; default: break; } Qs_Text_Mark::setWordSplitters(array()); $searchContent = $row['shortBio']; if ($row['searchContent'] && $row['shortBio']) { $searchContent .= ' | '; } $searchContent .= $row['searchContent']; $row['searchContent'] = Qs_Text_Mark::markSearchWords($searchContent, trim($_REQUEST['query'])); $row['title'] = Qs_Text_Mark::markSearchWords($row['name'], trim($_REQUEST['query'])); $row['jobTitle'] = Qs_Text_Mark::markSearchWords($row['jobTitle'], trim($_REQUEST['query'])); } return true; } public function getListSelect($options = array()) { $query = $this->_filter['query']; $peopleSelect = $this->_db->select() ->from($this->_getPair('People', false), array('id', 'name', 'jobTitle', 'shortBio', 'searchContent', 'image', 'type' => new Zend_Db_Expr('"People"'))); $anyWordResultPeople = clone $peopleSelect; $simpleResultPeople = clone $peopleSelect; Qs_Db_Filter::match($peopleSelect, $this->_filterFields, $query, true); Qs_Db_Filter::match($anyWordResultPeople, $this->_filterFields, $query); Qs_Db_Filter::where($simpleResultPeople, $this->_filterFields, $query); $this->select->reset()->union(array( $peopleSelect, $anyWordResultPeople, $simpleResultPeople, )); $this->_prepareListOptions($options); return $this->select; } public function getList($options = array()) { $stmt = $this->getListStatement($options); $list = $stmt->fetchAll(); $this->_prepareList($list); if (is_array($list) && count($list)) { $session = new Qs_Session_Namespace('JC_SEARCH'); $session->flagContent = true; } return $list; } public function getPaginatorAdapter() { $select = $this->_getSelect()->reset(Zend_Db_Select::LIMIT_COUNT)->reset(Zend_Db_Select::LIMIT_OFFSET); return $select; } protected function _filterWhere(Zend_Db_Select $select) { if (!empty($this->_filterFields) && array_key_exists('query', $this->_filter)) { Qs_Db_Filter::where($select, $this->_filterFields, $this->_filter['query']); } return $select; } }