You are here

protected function apachesolr_views_query::rebuild_fq in Apache Solr Views 6

build up the filter query params that are passed to Solr

2 calls to apachesolr_views_query::rebuild_fq()
apachesolr_views_query::build in ./apachesolr_views_query.inc
Build the query object. Load up all avaivable facets so the blocks work.
apachesolr_views_query::get_fq in ./apachesolr_views_query.inc

File

./apachesolr_views_query.inc, line 963

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 rebuild_fq() {
  $query_filters = array();
  foreach ($this->_facets as $type => $facets) {
    $filter_string = '';
    foreach ($facets as $definition) {
      if ($definition['exclude']) {
        $type_string = "NOT {$type}";
      }
      else {
        $type_string = $type;
      }
      $query_filters[] = "{$type_string}:" . $definition['value'];
    }
  }
  $query_filters[] = "entity:" . $this->sql_base_table;
  return $query_filters;
}