You are here

protected function apachesolr_views_query::part_of_facet_block in Apache Solr Views 6

determine if argument field is part of a facet block

Return value

bool Whether or not the provided argument could be in a facet block

1 call to apachesolr_views_query::part_of_facet_block()
apachesolr_views_query::get_path in ./apachesolr_views_query.inc
return the search path

File

./apachesolr_views_query.inc, line 688

Class

apachesolr_views_query
Class for handling a view that gets its data not from the database, but from a Solr server.

Code

protected function part_of_facet_block($argument) {
  foreach (apachesolr_get_enabled_facets() as $module => $module_facets) {
    foreach ($module_facets as $delta => $facet_field) {
      $facet_arguments[] = $facet_field;
    }
  }

  // Facets are IM_* where as argument are tid so this is a quick fix
  if (!empty($facet_arguments) && $argument->field == "tid") {
    return true;
  }

  // we use field instead of real_field
  // because we want these specific ones defined in
  // apachesolr_views.views.inc
  return in_array($argument->field, $facet_arguments);
}