You are here

function Solr_Base_Query::__construct in Apache Solr Search 6

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

Parameters

$solr: An instantiated Apache_Solr_Service Object. Can be instantiated from apachesolr_get_solr().

$keys: The string that a user would type into the search box. Suitable input may come from search_get_keys().

$filterstring: Key and value pairs that are applied as filter queries.

$sortstring: Visible string telling solr how to sort - added to GET query params.

$base_path: The search base path (without the keywords) for this query, without trailing slash.

File

./Solr_Base_Query.php, line 140

Class

Solr_Base_Query

Code

function __construct($solr, $keys, $filterstring, $sortstring, $base_path) {
  $this->solr = $solr;
  $this->keys = trim($keys);
  $this->filterstring = trim($filterstring);
  $this
    ->parse_filters();
  $this->available_sorts = $this
    ->default_sorts();
  $this->sortstring = trim($sortstring);
  $this
    ->parse_sortstring();
  $this->base_path = $base_path;
  $this->id = ++self::$idCount;
}