Skip to content

Instantly share code, notes, and snippets.

@dbolser
Created August 8, 2012 13:53
Show Gist options
  • Save dbolser/3295160 to your computer and use it in GitHub Desktop.
Save dbolser/3295160 to your computer and use it in GitHub Desktop.
/**
* Implements hook_facetapi_facet_info().
* Provides the definitions for the extra facets.
*
* @param array $searcher_info
* The definition of the searcher that facets are being collected for.
*
* @return array
* An associative array keyed by unique name of the facet.
*/
function apachesolr_external_index_facetapi_facet_info($searcher_info) {
$facets = array();
$searcher_info = facetapi_get_searcher_info();
$facets['cat'] = array(
'name' => 'category',
'label' => t('Category'),
'description' => t('Filter by category.'),
'field' => 'ss_cat',
'field alias' => 'cat',
'field api bundles' => array('node'),
'facet mincount allowed' => TRUE,
'dependency plugins' => array('bundle', 'role'),
);
return $facets;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment