You are here

public function SearchFacetapiAdapter::getFacetQueryExtender in Faceted Navigation for Search 7

Sets the facet query object.

Return value

FacetapiQuery

File

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

Class

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

Code

public function getFacetQueryExtender() {
  if (!$this->facetQueryExtender) {
    $this->facetQueryExtender = db_select('search_index', 'i', array(
      'target' => 'slave',
    ))
      ->extend('FacetapiQuery');
    $this->facetQueryExtender
      ->join('node', 'n', 'n.nid = i.sid');
    $this->facetQueryExtender
      ->condition('n.status', 1)
      ->addTag('node_access')
      ->searchExpression($this->keys, 'node');
  }
  return $this->facetQueryExtender;
}