3

I have business requirements to do a total overhaul of the Search Results page for our site. Based on the searching i've done so far, I have a few options to adjust the results pulled by the search:

Here are the challenges i'm running into:

  • I have a custom module (example_search.module) with a hook_search_page() call that does not adjust the actual display of results. It insists on showing the OLs with an "apachesolr_search-results" class, which means any changes i'm making are being ignored. Am I missing anything here?
  • the tpl.php files, on the other hand work as expected. No big deal there. But I need to adjust how results are rendered.
  • I also need to adjust the layout of the search results using Context and Delta. I've applied rules using the "Apache Solr" conditions in Context for a custom delta with nothing sticking. Not sure why that's happening.

So in essence, what's the optimal way to adjust results returned by hook_search_page() within Apache Solr?

The code from my search module is below:

<?php

/**
 * Implements hook_search_page()
 */
function example_search_page($results) {
  dpm($results, "Results");

  $output['prefix']['#markup'] = '<ol class="search-results testclass">';

  foreach ($results as $entry) {
    $output[] = array(
      '#theme' => 'search_result',
      '#result' => $entry,
      '#module' => 'mwb_search',
    );
  }
  $output['suffix']['#markup'] = '</ol>' . theme('pager');

  return $output;
}
1
  • Did you ever make any headway on this?
    – user1359
    Commented Aug 9, 2017 at 15:18

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.