Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8686637
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T22:54:16+00:00 2026-06-12T22:54:16+00:00

Below is the code which i use for preprocessing the apache solr search results,

  • 0

Below is the code which i use for preprocessing the apache solr search results,

function apachesolr_search_apachesolr_process_results(&$results, DrupalSolrQueryInterface $query) {
    $rows = array();
    foreach ($results as $key => $fields) {

        $rows [] = array(
            'title' => t($fields['fields']['title']),
            'Category' => $fields['fields']['category'],
            'Dper' => $fields['fields']['crtor'],
            'pvalue' => $fields['fields']['pvalue'],
            'rvalue' => $fields['fields']['rvalue'],
            'avalue' => $fields['fields']['avalue'],
        );
    }

    $header = array(
        array('data' => 'title', 'field' => 'title', 'sort' => 'ASC'),
        array('data' => 'category', 'field' => 'category', 'sort' => 'ASC'),
        array('data' => 'creator', 'field' => 'creator', 'sort' => 'ASC'),
        array('data' => 'pvalue', 'field' => 'pvalue'),
        array('data' => 'rvalue', 'field' => 'rvalue'),
        array('data' => 'avalue', 'field' => 'avalue'),
    );

    $results['processresults'] = theme('table', array('header' => $header, 'rows' => $rows));
    $results['processresults'] .= theme('pager');

    return $results;
}

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.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T22:54:17+00:00Added an answer on June 12, 2026 at 10:54 pm

    The $results variable that’s passed into the process_results() hook would have to maintain a certain structure for it to be able to continue working with the remainder of the hooks and templates that may be called on it.

    So what I’d do if you want to customize your search results is look at the search-results.tpl.php and search-result.tpl.php template files (note the singular in the second one).

    You can find copies of those in the core search module, and I’d just copy and paste those entire files (no need to even rename them) and put them in your custom theme’s /templates/ folder. After clearing your cache, they should get picked up since they will have precedence now.

    The search-results.tpl.php file controls how the entire search results page looks, while the search-result.tpl.php file controls who an individual search result is displayed (which fields, in which order, etc). Now that you have copies in your own custom theme, modify them any way you want!

    Hopefully this is enough to get you started!!

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Can anyone help me to rewrite the below code which use a fade effect
I have the code below which I use clone() and live() . The code
I have the code below which I use clone() and delegate() . The code
Hi All below is the code which i use. <!DOCTYPE html PUBLIC -//W3C//DTD XHTML
I have the code below which works fine, steps through the rows pinging each
I use below code which works fine for me in FF but Problem in
Below is code which includes a variadic function and calls to the variadic function.
Below is the code snippet which I use to get a list of all
I have the below xml code which i use to display inside a Dialog.
Currently i'm using below code which works well. $(#topperAtBaseLevel:visible, #lowerAtBaseLevel:visible, #midAtBaseLevel).hide(); any optimised code?

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.