function apachesolr_stats_get_facets in Apache Solr Statistics 6
Same name and namespace in other branches
- 6.3 apachesolr_stats.module \apachesolr_stats_get_facets()
 - 7 apachesolr_stats.module \apachesolr_stats_get_facets()
 
Returns the facet array to report on.
1 call to apachesolr_stats_get_facets()
- apachesolr_stats_generate_report_elements in ./
apachesolr_stats.module  - Generates report elements for the given granularity.
 
File
- ./
apachesolr_stats.module, line 669  - Keeps and reports statistics about Apache Solr usage and performance.
 
Code
function apachesolr_stats_get_facets() {
  $all_facets = module_invoke_all('apachesolr_facets');
  // Keep only those enabled according to apachesolr_get_enabled_facets()
  $facets = array();
  foreach (apachesolr_get_enabled_facets() as $module => $enabled) {
    foreach ($enabled as $key => $facet_id) {
      $facets[$facet_id] = $all_facets[$key];
      $facets[$facet_id]['usage'] = 0;
    }
  }
  // Add some "virtual" facets to report on.
  $facets['kw'] = array(
    'facet_field' => 'kw',
    'info' => 'Keyword search',
    'usage' => 0,
  );
  $facets['any'] = array(
    'facet_field' => 'any',
    'info' => '[All queries including any filter and/or keywords]',
    'usage' => 0,
  );
  /*
  $facets['none'] = array(
    'facet_field' => 'none',
    'info' => '[Clickthrus with no previous queries]',
  );
  */
  return $facets;
}