function apachesolr_multisitesearch_apachesolr_process_results in Apache Solr Multisite Search 6.3
Same name and namespace in other branches
- 6 apachesolr_multisitesearch.module \apachesolr_multisitesearch_apachesolr_process_results()
- 6.2 apachesolr_multisitesearch.module \apachesolr_multisitesearch_apachesolr_process_results()
- 7 apachesolr_multisitesearch.module \apachesolr_multisitesearch_apachesolr_process_results()
Implements hook_apachesolr_process_results().
Changes the links from results that come out of another index
Parameters
array $results:
DrupalSolrQueryInterface $query:
File
- ./
apachesolr_multisitesearch.module, line 121 - Provides a multi-site search implementation for use with the Apache Solr module
Code
function apachesolr_multisitesearch_apachesolr_process_results(&$results, DrupalSolrQueryInterface $query) {
$env_id = $query
->solr('getId');
$multisite = apachesolr_environment_variable_get($env_id, 'multisitesearch');
if (!empty($multisite)) {
foreach ($results as $id => $result) {
$results[$id]['extra']['hash'] = theme('apachesolr_multisitesearch_breadcrumb_hash', array(
'hash' => $results[$id]['fields']['hash'],
));
// Fix up results from remote sites.
if ($results[$id]['fields']['hash'] != apachesolr_site_hash()) {
$results[$id]['link'] = $results[$id]['fields']['url'];
if (isset($results[$id]['user']) && !empty($results[$id]['fields']['name'])) {
$results[$id]['user'] = check_plain($results[$id]['fields']['name']);
}
}
}
}
}