You are here

function apachesolr_og_map_gid_label in Apache Solr Organic Groups Integration 7

Maps prganic group names to their human friendly label and adds a Your Groups facet

Parameters

array $values: An array of indexed values being mapped.

array $options: An associative array of map options containing:

  • entities: An array of entities that $values are bundles for.

Return value

array An array mapping the indexed values to human readable values.

1 string reference to 'apachesolr_og_map_gid_label'
apachesolr_og_apachesolr_field_mappings_alter in ./apachesolr_og.module
Implements hook_apachesolr_field_mappings_alter().

File

./apachesolr_og.module, line 81
Integrates Organic Group info with Apache Solr search application.

Code

function apachesolr_og_map_gid_label(array $ids, array $options) {
  global $user;
  $my_groups_filter_string = apachesolr_og_get_my_groups_filter();

  // Remove the value we are looking for
  if (($key = array_search($my_groups_filter_string, $ids)) !== false) {
    unset($ids[$key]);
  }
  $map = apachesolr_entityreference_facet_map_callback($ids, $options);
  $map[$my_groups_filter_string] = t('Your groups');
  return $map;
}