You are here

function apachesolr_search_run_empty in Apache Solr Search 8

Same name and namespace in other branches
  1. 6.3 apachesolr_search.module \apachesolr_search_run_empty()
  2. 7 apachesolr_search.module \apachesolr_search_run_empty()

Execute a search with zero results rows so as to populate facets.

2 calls to apachesolr_search_run_empty()
apachesolr_search_init in ./apachesolr_search.module
Implements hook_init().
apachesolr_search_search_results in ./apachesolr_search.module
Executes search depending on the conditions given. See apachesolr_search.pages.inc for another use of this function

File

./apachesolr_search.module, line 1028
Provides a content search implementation for node content for use with the Apache Solr search application.

Code

function apachesolr_search_run_empty($name, array $params = array(), $base_path = '', $solr = NULL, $context = array()) {
  $query = apachesolr_drupal_query($name, $params, '', $base_path, $solr, $context);
  $query
    ->addParam('rows', '0');
  $solr_id = $query
    ->solr('getId');
  list($final_query, $response) = apachesolr_do_query($query);
  apachesolr_has_searched($solr_id, TRUE);
}