title: Drupal 7 generating search results in apache solr
body: <p>Below is the code which i use for preprocessing the apache solr search results,</p>
  
  <pre><code>function apachesolr_search_apachesolr_process_results(&amp;$results, DrupalSolrQueryInterface $query) {
      $rows = array();
      foreach ($results as $key =&gt; $fields) {
  
          $rows [] = array(
              'title' =&gt; t($fields['fields']['title']),
              'Category' =&gt; $fields['fields']['category'],
              'Dper' =&gt; $fields['fields']['crtor'],
              'pvalue' =&gt; $fields['fields']['pvalue'],
              'rvalue' =&gt; $fields['fields']['rvalue'],
              'avalue' =&gt; $fields['fields']['avalue'],
          );
      }
  
      $header = array(
          array('data' =&gt; 'title', 'field' =&gt; 'title', 'sort' =&gt; 'ASC'),
          array('data' =&gt; 'category', 'field' =&gt; 'category', 'sort' =&gt; 'ASC'),
          array('data' =&gt; 'creator', 'field' =&gt; 'creator', 'sort' =&gt; 'ASC'),
          array('data' =&gt; 'pvalue', 'field' =&gt; 'pvalue'),
          array('data' =&gt; 'rvalue', 'field' =&gt; 'rvalue'),
          array('data' =&gt; 'avalue', 'field' =&gt; 'avalue'),
      );
  
      $results['processresults'] = theme('table', array('header' =&gt; $header, 'rows' =&gt; $rows));
      $results['processresults'] .= theme('pager');
  
      return $results;
  }
  </code></pre>
  
  <p>When i print the $results['processresults'] in the same function and give exit the table has been generated. if i return the $results and the table is not getting displayed in my apache solr search results page.</p>