示例#1
0
 /**
  * Use the record driver to build an array of HTML displays from the search
  * results.
  *
  * @access  public
  * @return  array   Array of HTML chunks for individual records.
  */
 public function getResultRecordHTML()
 {
     global $interface;
     $html = array();
     for ($x = 0; $x < count($this->indexResult['response']['docs']); $x++) {
         $current =& $this->indexResult['response']['docs'][$x];
         if (!$this->debug) {
             unset($current['explain']);
             unset($current['score']);
         }
         $interface->assign('recordIndex', $x + 1);
         $interface->assign('resultIndex', $x + 1 + ($this->page - 1) * $this->limit);
         $record = RecordDriverFactory::initRecordDriver($current);
         $record->setScopingEnabled($this->indexEngine->isScopingEnabled());
         if (!PEAR_Singleton::isError($record)) {
             $interface->assign('recordDriver', $record);
             $html[] = $interface->fetch($record->getSearchResult($this->view));
         } else {
             $html[] = "Unable to find record";
         }
     }
     return $html;
 }