From 7ecd5155e52fd7810610f2c6a936cd8efebe7cf9 Mon Sep 17 00:00:00 2001 From: Fabian Stelzer Date: Thu, 21 May 2015 09:01:17 -0700 Subject: [PATCH] elasticsearch host quick fix Summary: Quick fix for the elasticsearch search engine Ref T8274 Test Plan: Did a couple of searches Reviewers: #blessed_reviewers, epriestley Reviewed By: #blessed_reviewers, epriestley Subscribers: Korvin, epriestley Maniphest Tasks: T8274 Differential Revision: https://secure.phabricator.com/D12967 --- .../search/engine/PhabricatorElasticSearchEngine.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/applications/search/engine/PhabricatorElasticSearchEngine.php b/src/applications/search/engine/PhabricatorElasticSearchEngine.php index f6efc17044..fa09e64a9c 100644 --- a/src/applications/search/engine/PhabricatorElasticSearchEngine.php +++ b/src/applications/search/engine/PhabricatorElasticSearchEngine.php @@ -6,6 +6,11 @@ final class PhabricatorElasticSearchEngine extends PhabricatorSearchEngine { private $index; private $timeout; + public function __construct() { + $this->uri = PhabricatorEnv::getEnvConfig('search.elastic.host'); + $this->index = PhabricatorEnv::getEnvConfig('search.elastic.namespace'); + } + public function getEngineIdentifier() { return 'elasticsearch'; } @@ -15,7 +20,7 @@ final class PhabricatorElasticSearchEngine extends PhabricatorSearchEngine { } public function isEnabled() { - return (bool)PhabricatorEnv::getEnvConfig('search.elastic.host'); + return (bool)$this->uri; } public function setURI($uri) {