You are here

public function SolrBaseQuery::addContext in Apache Solr Search 6.3

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

Set context value.

Overrides DrupalSolrQueryInterface::addContext

1 call to SolrBaseQuery::addContext()
SolrBaseQuery::__construct in ./Solr_Base_Query.php

File

./Solr_Base_Query.php, line 352
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 addContext(array $context) {
  foreach ($context as $k => $v) {
    $this->context[$k] = $v;
  }

  // The env_id must match that of the actual $solr object
  $this->context['env_id'] = $this->solr
    ->getId();
  return $this->context;
}