Exemplo n.º 1
0
 /**
  * Performs a type specific search.
  *
  * @param XenForo_Search_DataHandler_Abstract $typeHandler Data handler for the type of search
  * @param string $searchQuery Text to search for
  * @param array $constraints Constraints to apply; handled by source handlers
  * @param string $order Ordering; handled by source handlers
  * @param boolean $groupByDiscussion If true, fold/group the results by the discussion_id value
  * @param integer $maxResults Maximum number of results to return
  *
  * @return array Search results: [] => array(content_type => x, content_id => y)
  */
 public function searchType(XenForo_Search_DataHandler_Abstract $typeHandler, $searchQuery, array $constraints = array(), $order, $groupByDiscussion, $maxResults)
 {
     $titleOnly = isset($constraints['title_only']);
     unset($constraints['title_only']);
     $constraints['content'] = $typeHandler->getSearchContentTypes();
     $constraints = $typeHandler->filterConstraints($this, $constraints);
     $processedConstraints = $this->processConstraints($constraints, $typeHandler);
     $orderClause = $typeHandler->getOrderClause($order);
     if (!$orderClause) {
         $orderClause = $this->getGeneralOrderClause($order);
     }
     $groupByDiscussionType = $groupByDiscussion ? $typeHandler->getGroupByType() : '';
     return $this->executeSearch($searchQuery, $titleOnly, $processedConstraints, $orderClause, $groupByDiscussionType, $maxResults, $typeHandler);
 }