You are here

function apachesolr_attachments_facetapi_facet_info_alter in Apache Solr Attachments 7

Implements hook_facetapi_facet_info_alter().

File

./apachesolr_attachments.module, line 766
Provides a file attachment search implementation for use with the Apache Solr module

Code

function apachesolr_attachments_facetapi_facet_info_alter(&$facet_info, $searcher_info) {

  // Ensure that file entities will be correctly included in the list when
  // filtering by bundle. Since facetapi_map_bundle() defaults to the 'node'
  // entity when none are set, we need to explicitly include that when the list
  // starts off empty.
  if (!empty($facet_info['bundle']['map options']['entities'])) {
    $facet_info['bundle']['map options']['entities'][] = 'file';
  }
  else {
    $facet_info['bundle']['map options']['entities'] = array(
      'node',
      'file',
    );
  }
}