You are here

public function Solr_Base_Query::set_solrsort in Apache Solr Search 6

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

Set the solrsort.

Parameters

$field: The name of a field in the solr index that's an allowed sort.

$direction: 'asc' or 'desc'

Overrides Drupal_Solr_Query_Interface::set_solrsort

1 call to Solr_Base_Query::set_solrsort()
Solr_Base_Query::parse_sortstring in ./Solr_Base_Query.php

File

./Solr_Base_Query.php, line 319

Class

Solr_Base_Query

Code

public function set_solrsort($name, $direction) {
  if (isset($this->available_sorts[$name])) {
    $this->solrsort = array(
      '#name' => $name,
      '#direction' => $direction,
    );
  }
}