You are here

function ApacheSolrFacetapiAdapter::initActiveFilters in Apache Solr Search 7

Same name and namespace in other branches
  1. 8 plugins/facetapi/adapter.inc \ApacheSolrFacetapiAdapter::initActiveFilters()
  2. 6.3 plugins/facetapi/adapter.inc \ApacheSolrFacetapiAdapter::initActiveFilters()

Allows the backend to initialize its query object before adding the facet filters.

Parameters

mixed $query: The backend's native object.

File

plugins/facetapi/adapter.inc, line 44
Classes used by the Facet API module.

Class

ApacheSolrFacetapiAdapter
Facet API adapter for the Apache Solr Search Integration module.

Code

function initActiveFilters($query) {
  $enabled_facets = facetapi_get_enabled_facets($this->info['name']);
  if ($enabled_facets) {
    $query
      ->addParam('facet', 'true');
    $query
      ->addParam('facet.sort', 'count');
    $query
      ->addParam('facet.mincount', '1');
  }
}