You are here

function apachesolr_get_facet_definition_by_field_name in Apache Solr Search 6.2

Returns a member of the facet definitions array if it contains $field_name as the 'field_name' element.

Parameters

string $field_name: The field_name being sought.

Return value

A facet definition.

1 call to apachesolr_get_facet_definition_by_field_name()
apachesolr_search_nested_facet_items in ./apachesolr_search.module
Recursive function that returns a nested array of facet values for use with theme_item_list().

File

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

Code

function apachesolr_get_facet_definition_by_field_name($field_name) {
  $definitions = apachesolr_get_facet_definitions();
  foreach ($definitions as $module => $facets) {
    foreach ($facets as $key => $values) {
      if (isset($values['facet_field']) && $values['facet_field'] == $field_name) {
        return $definitions[$module][$key];
      }
    }
  }
}