You are here

public function SolrBaseQuery::getSolrsortUrlQuery in Apache Solr Search 6.3

Same name and namespace in other branches
  1. 8 Solr_Base_Query.php \SolrBaseQuery::getSolrsortUrlQuery()
  2. 7 Solr_Base_Query.php \SolrBaseQuery::getSolrsortUrlQuery()

Returns an array representing the URL query string for the current sort.

Return value

array The URL query string for the current sort.

Overrides DrupalSolrQueryInterface::getSolrsortUrlQuery

File

./Solr_Base_Query.php, line 629
This class allows you to make operations on a query that will be sent to Apache Solr. methods such as adding and removing sorts, remove and replace parameters, adding and removing filters, getters and setters for various parameters and more

Class

SolrBaseQuery

Code

public function getSolrsortUrlQuery() {
  $queryvalues = array();
  $solrsort = $this->solrsort;
  if ($solrsort && $solrsort['#name'] != 'score') {
    if (isset($this->field_map[$solrsort['#name']])) {
      $solrsort['#name'] = $this->field_map[$solrsort['#name']];
    }
    $queryvalues['solrsort'] = $solrsort['#name'] . ' ' . $solrsort['#direction'];
  }
  else {

    // Return to default relevancy sort.
    unset($queryvalues['solrsort']);
  }
  return $queryvalues;
}