Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F1854070
T9779.diff
20after4 (Mukunda Modell)
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Authored By
20after4
Sep 29 2016, 10:10 PM
2016-09-29 22:10:12 (UTC+0)
Size
2 KB
Referenced Files
None
Subscribers
None
T9779.diff
View Options
diff --git a/src/applications/search/config/PhabricatorSearchConfigOptions.php b/src/applications/search/config/PhabricatorSearchConfigOptions.php
index 2f2cc4f..78ad037 100644
--- a/src/applications/search/config/PhabricatorSearchConfigOptions.php
+++ b/src/applications/search/config/PhabricatorSearchConfigOptions.php
@@ -29,6 +29,9 @@ final class PhabricatorSearchConfigOptions
->setLocked(true)
->setDescription(pht('Elastic Search index.'))
->addExample('phabricator2', pht('Valid Setting')),
+ $this->newOption('search.elastic.version', 'string', null)
+ ->setLocked(true)
+ ->setDescription(pht('Elastic Version, used for functions that work for a specific elastic version.'))
);
}
diff --git a/src/applications/search/fulltextstorage/PhabricatorElasticFulltextStorageEngine.php b/src/applications/search/fulltextstorage/PhabricatorElasticFulltextStorageEngine.php
index ee067b9..831a488 100644
--- a/src/applications/search/fulltextstorage/PhabricatorElasticFulltextStorageEngine.php
+++ b/src/applications/search/fulltextstorage/PhabricatorElasticFulltextStorageEngine.php
@@ -6,10 +6,12 @@ final class PhabricatorElasticFulltextStorageEngine
private $uri;
private $index;
private $timeout;
-
+ private $version;
+
public function __construct() {
$this->uri = PhabricatorEnv::getEnvConfig('search.elastic.host');
$this->index = PhabricatorEnv::getEnvConfig('search.elastic.namespace');
+ $this->version = PhabricatorEnv::getEnvConfig('search.elastic.version');
}
public function getEngineIdentifier() {
@@ -284,7 +286,11 @@ final class PhabricatorElasticFulltextStorageEngine
public function indexExists() {
try {
- return (bool)$this->executeRequest('/_status/', array());
+ if ((int)$this->version >= 2) {
+ return (bool)$this->executeRequest('/', array(), 'GET');
+ } else {
+ return (bool)$this->executeRequest('/_status/', array());
+ }
} catch (HTTPFutureHTTPResponseStatus $e) {
if ($e->getStatusCode() == 404) {
return false;
File Metadata
Details
Attached
Mime Type
text/x-diff
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
292560
Default Alt Text
T9779.diff (2 KB)
Attached To
Mode
T9779: ./bin/search init error with elasticsearch 2.0
Attached
Detach File
Event Timeline
Log In to Comment