diff --git a/search/engine/solr/classes/engine.php b/search/engine/solr/classes/engine.php index 50042c3bfab..89410141905 100644 --- a/search/engine/solr/classes/engine.php +++ b/search/engine/solr/classes/engine.php @@ -1144,6 +1144,7 @@ class engine extends \core_search\engine { * @return \SolrClient */ protected function get_search_client($triggerexception = true) { + global $CFG; // Type comparison as it is set to false if not available. if ($this->client !== null) { @@ -1165,6 +1166,11 @@ class engine extends \core_search\engine { 'timeout' => !empty($this->config->server_timeout) ? $this->config->server_timeout : '30' ); + if ($CFG->proxyhost && !is_proxybypass('http://' . $this->config->server_hostname . '/')) { + $options['proxy_host'] = $CFG->proxyhost; + $options['proxy_port'] = $CFG->proxyport; + } + if (!class_exists('\SolrClient')) { throw new \core_search\engine_exception('enginenotinstalled', 'search', '', 'solr'); }