Changeset View
Changeset View
Standalone View
Standalone View
resources/sql/autopatches/20161130.search.02.rebuild.php
<?php | <?php | ||||
$search_engine = PhabricatorFulltextStorageEngine::loadEngine(); | |||||
$use_mysql = ($search_engine instanceof PhabricatorMySQLFulltextStorageEngine); | $use_mysql = false; | ||||
$services = PhabricatorSearchService::getAllServices(); | |||||
foreach ($services as $service) { | |||||
$engine = $service->getEngine(); | |||||
if ($engine instanceof PhabricatorMySQLFulltextStorageEngine) { | |||||
$use_mysql = true; | |||||
} | |||||
} | |||||
if ($use_mysql) { | if ($use_mysql) { | ||||
$field = new PhabricatorSearchDocumentField(); | $field = new PhabricatorSearchDocumentField(); | ||||
$conn = $field->establishConnection('r'); | $conn = $field->establishConnection('r'); | ||||
// We're only going to require this if the index isn't empty: if you're on a | // We're only going to require this if the index isn't empty: if you're on a | ||||
// fresh install, you don't have to do anything. | // fresh install, you don't have to do anything. | ||||
$any_documents = queryfx_one( | $any_documents = queryfx_one( | ||||
Show All 14 Lines |