Page MenuHomePhorge

PhabricatorDefaultSearchEngineSelector.php
No OneTemporary

PhabricatorDefaultSearchEngineSelector.php

<?php
final class PhabricatorDefaultSearchEngineSelector
extends PhabricatorSearchEngineSelector {
public function newEngine() {
if (self::shouldUseElasticSearch()) {
$elastic_host = PhabricatorEnv::getEnvConfig('search.elastic.host');
$elastic_index = PhabricatorEnv::getEnvConfig('search.elastic.namespace');
return new PhabricatorSearchEngineElastic($elastic_host, $elastic_index);
}
return new PhabricatorSearchEngineMySQL();
}
public static function shouldUseElasticSearch() {
return (bool)PhabricatorEnv::getEnvConfig('search.elastic.host');
}
}

File Metadata

Mime Type
text/x-php
Expires
Sun, Jan 19, 18:38 (1 w, 4 d ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
1127507
Default Alt Text
PhabricatorDefaultSearchEngineSelector.php (600 B)

Event Timeline