public function SolrBaseQuery::addContext in Apache Solr Search 8
Same name and namespace in other branches
- 6.3 Solr_Base_Query.php \SolrBaseQuery::addContext()
- 7 Solr_Base_Query.php \SolrBaseQuery::addContext()
Set context value.
Overrides DrupalSolrQueryInterface::addContext
1 call to SolrBaseQuery::addContext()
File
- ./
Solr_Base_Query.php, line 350 - 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
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;
}