Skip to content

Instantly share code, notes, and snippets.

@bleeDev
Last active September 27, 2015 06:08
Show Gist options
  • Save bleeDev/1223270 to your computer and use it in GitHub Desktop.
Save bleeDev/1223270 to your computer and use it in GitHub Desktop.
Extending Facet API for Mime Type 1
<?php
function MYMODULE_facetapi_facet_info($searcher_info) {
$facets = array();
$facets['mime'] = array(
'label' => t('Mime Type'),
'description' => t('Filter by mime type.'),
//indexed field from solr
'field' => 'ss_filemime',
'map callback' => 'MYMODULE_map_mime',
'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