You are here

function apachesolr_get_facet_definitions in Apache Solr Search 6.2

6 calls to apachesolr_get_facet_definitions()
apachesolr_block_visibility in ./apachesolr.module
This code makes a decision whether to show a block or not.
apachesolr_form_block_admin_configure_alter in ./apachesolr.module
Implementation of hook_form_[form_id]_alter().
apachesolr_get_facet_definition_by_field_name in ./apachesolr.module
Returns a member of the facet definitions array if it contains $field_name as the 'field_name' element.
apachesolr_js in ./apachesolr.module
apachesolr_search_add_facet_params in ./apachesolr_search.module

... See full list

File

./apachesolr.module, line 937
Integration with the Apache Solr search application.

Code

function apachesolr_get_facet_definitions() {
  static $definitions;
  if (!isset($definitions)) {
    $operator_settings = variable_get('apachesolr_operator', array());
    foreach (module_implements('apachesolr_facets') as $module) {
      $facets = module_invoke($module, 'apachesolr_facets');
      if (!empty($facets)) {
        foreach ($facets as $delta => $info) {
          $definitions[$module][$delta] = $info;
          if (isset($definitions[$module][$delta])) {
            $definitions[$module][$delta]['operator'] = isset($operator_settings[$module][$delta]) ? $operator_settings[$module][$delta] : 'AND';
          }
        }
      }
    }
  }
  return $definitions;
}