You are here

public function Solr_Base_Query::get_url_queryvalues in Apache Solr Search 5.2

Same name and namespace in other branches
  1. 6 Solr_Base_Query.php \Solr_Base_Query::get_url_queryvalues()
  2. 6.2 Solr_Base_Query.php \Solr_Base_Query::get_url_queryvalues()

Return filters and sort in a form suitable for a query param to url().

Overrides Drupal_Solr_Query_Interface::get_url_queryvalues

File

./Solr_Base_Query.php, line 327

Class

Solr_Base_Query

Code

public function get_url_queryvalues() {
  $queryvalues = array();
  if ($fq = $this
    ->rebuild_fq(TRUE)) {
    $queryvalues['filters'] = implode(' ', $fq);
  }
  $solrsort = $this->solrsort;
  if ($solrsort && ($solrsort['#name'] != 'score' || $solrsort['#direction'] != 'asc')) {
    if (isset($this->field_map[$solrsort['#name']])) {
      $solrsort['#name'] = $this->field_map[$solrsort['#name']];
    }
    $queryvalues['solrsort'] = $solrsort['#name'] . ' ' . $solrsort['#direction'];
  }
  return $queryvalues;
}