You are here

function apachesolr_user_facetapi_facet_info in Apachesolr User 7

Implements hook_facetapi_facet_info().

File

./apachesolr_user.module, line 221
Indexer for the user entities for the Apachesolr module.

Code

function apachesolr_user_facetapi_facet_info($searcher_info) {
  $facets = array();
  if (isset($searcher_info['types']['user'])) {
    $facets['rid'] = array(
      'label' => t('Role'),
      'description' => t('Filter by user role.'),
      'field' => 'im_rids',
      'map callback' => 'user_roles',
      'values callback' => 'facetapi_callback_user_values',
      'facet mincount allowed' => TRUE,
      'dependency plugins' => array(
        'bundle',
        'role',
      ),
    );

    // Add facets for all fields attached to the user entity.
    $facets = array_merge($facets, apachesolr_entity_field_facets('user'));
  }
  return $facets;
}