mirror of
https://we.phorge.it/source/phorge.git
synced 2024-11-19 05:12:41 +01:00
Rename "SearchEngine" to "FulltextStorageEngine"
Summary: Ref T9979. I picked this name long before the advent of modern "Engine" architecture and it ended up being pretty confusing. Rename "SearchEngine" (currently: mysql or elasticsearch, used to store and query fulltext indexes) to "FulltextStorageEngine" to make it more clear what it does and disambituate it from ApplicationSearch, which also has a bunch of stuff called "SearchEngine", "SearchEngineExtension", etc. Test Plan: Grepped for `phabricatorsearchengine`. Reviewers: chad Reviewed By: chad Maniphest Tasks: T9979 Differential Revision: https://secure.phabricator.com/D14843
This commit is contained in:
parent
99c9df96b4
commit
23c42486e4
12 changed files with 23 additions and 21 deletions
|
@ -2194,7 +2194,7 @@ phutil_register_library_map(array(
|
|||
'PhabricatorEditField' => 'applications/transactions/editfield/PhabricatorEditField.php',
|
||||
'PhabricatorEditType' => 'applications/transactions/edittype/PhabricatorEditType.php',
|
||||
'PhabricatorEditor' => 'infrastructure/PhabricatorEditor.php',
|
||||
'PhabricatorElasticSearchEngine' => 'applications/search/engine/PhabricatorElasticSearchEngine.php',
|
||||
'PhabricatorElasticFulltextStorageEngine' => 'applications/search/fulltextstorage/PhabricatorElasticFulltextStorageEngine.php',
|
||||
'PhabricatorElasticSearchSetupCheck' => 'applications/config/check/PhabricatorElasticSearchSetupCheck.php',
|
||||
'PhabricatorEmailAddressesSettingsPanel' => 'applications/settings/panel/PhabricatorEmailAddressesSettingsPanel.php',
|
||||
'PhabricatorEmailFormatSettingsPanel' => 'applications/settings/panel/PhabricatorEmailFormatSettingsPanel.php',
|
||||
|
@ -2333,6 +2333,7 @@ phutil_register_library_map(array(
|
|||
'PhabricatorFulltextEngineExtensionModule' => 'applications/search/index/PhabricatorFulltextEngineExtensionModule.php',
|
||||
'PhabricatorFulltextIndexEngineExtension' => 'applications/search/engineextension/PhabricatorFulltextIndexEngineExtension.php',
|
||||
'PhabricatorFulltextInterface' => 'applications/search/interface/PhabricatorFulltextInterface.php',
|
||||
'PhabricatorFulltextStorageEngine' => 'applications/search/fulltextstorage/PhabricatorFulltextStorageEngine.php',
|
||||
'PhabricatorFundApplication' => 'applications/fund/application/PhabricatorFundApplication.php',
|
||||
'PhabricatorGDSetupCheck' => 'applications/config/check/PhabricatorGDSetupCheck.php',
|
||||
'PhabricatorGarbageCollector' => 'infrastructure/daemon/garbagecollector/PhabricatorGarbageCollector.php',
|
||||
|
@ -2541,7 +2542,7 @@ phutil_register_library_map(array(
|
|||
'PhabricatorMustVerifyEmailController' => 'applications/auth/controller/PhabricatorMustVerifyEmailController.php',
|
||||
'PhabricatorMySQLConfigOptions' => 'applications/config/option/PhabricatorMySQLConfigOptions.php',
|
||||
'PhabricatorMySQLFileStorageEngine' => 'applications/files/engine/PhabricatorMySQLFileStorageEngine.php',
|
||||
'PhabricatorMySQLSearchEngine' => 'applications/search/engine/PhabricatorMySQLSearchEngine.php',
|
||||
'PhabricatorMySQLFulltextStorageEngine' => 'applications/search/fulltextstorage/PhabricatorMySQLFulltextStorageEngine.php',
|
||||
'PhabricatorMySQLSetupCheck' => 'applications/config/check/PhabricatorMySQLSetupCheck.php',
|
||||
'PhabricatorNamedQuery' => 'applications/search/storage/PhabricatorNamedQuery.php',
|
||||
'PhabricatorNamedQueryQuery' => 'applications/search/query/PhabricatorNamedQueryQuery.php',
|
||||
|
@ -3034,7 +3035,6 @@ phutil_register_library_map(array(
|
|||
'PhabricatorSearchDocumentRelationship' => 'applications/search/storage/document/PhabricatorSearchDocumentRelationship.php',
|
||||
'PhabricatorSearchDocumentTypeDatasource' => 'applications/search/typeahead/PhabricatorSearchDocumentTypeDatasource.php',
|
||||
'PhabricatorSearchEditController' => 'applications/search/controller/PhabricatorSearchEditController.php',
|
||||
'PhabricatorSearchEngine' => 'applications/search/engine/PhabricatorSearchEngine.php',
|
||||
'PhabricatorSearchEngineAPIMethod' => 'applications/search/engine/PhabricatorSearchEngineAPIMethod.php',
|
||||
'PhabricatorSearchEngineAttachment' => 'applications/search/engineextension/PhabricatorSearchEngineAttachment.php',
|
||||
'PhabricatorSearchEngineExtension' => 'applications/search/engineextension/PhabricatorSearchEngineExtension.php',
|
||||
|
@ -6398,7 +6398,7 @@ phutil_register_library_map(array(
|
|||
'PhabricatorEditField' => 'Phobject',
|
||||
'PhabricatorEditType' => 'Phobject',
|
||||
'PhabricatorEditor' => 'Phobject',
|
||||
'PhabricatorElasticSearchEngine' => 'PhabricatorSearchEngine',
|
||||
'PhabricatorElasticFulltextStorageEngine' => 'PhabricatorFulltextStorageEngine',
|
||||
'PhabricatorElasticSearchSetupCheck' => 'PhabricatorSetupCheck',
|
||||
'PhabricatorEmailAddressesSettingsPanel' => 'PhabricatorSettingsPanel',
|
||||
'PhabricatorEmailFormatSettingsPanel' => 'PhabricatorSettingsPanel',
|
||||
|
@ -6567,6 +6567,7 @@ phutil_register_library_map(array(
|
|||
'PhabricatorFulltextEngineExtension' => 'Phobject',
|
||||
'PhabricatorFulltextEngineExtensionModule' => 'PhabricatorConfigModule',
|
||||
'PhabricatorFulltextIndexEngineExtension' => 'PhabricatorIndexEngineExtension',
|
||||
'PhabricatorFulltextStorageEngine' => 'Phobject',
|
||||
'PhabricatorFundApplication' => 'PhabricatorApplication',
|
||||
'PhabricatorGDSetupCheck' => 'PhabricatorSetupCheck',
|
||||
'PhabricatorGarbageCollector' => 'Phobject',
|
||||
|
@ -6790,7 +6791,7 @@ phutil_register_library_map(array(
|
|||
'PhabricatorMustVerifyEmailController' => 'PhabricatorAuthController',
|
||||
'PhabricatorMySQLConfigOptions' => 'PhabricatorApplicationConfigOptions',
|
||||
'PhabricatorMySQLFileStorageEngine' => 'PhabricatorFileStorageEngine',
|
||||
'PhabricatorMySQLSearchEngine' => 'PhabricatorSearchEngine',
|
||||
'PhabricatorMySQLFulltextStorageEngine' => 'PhabricatorFulltextStorageEngine',
|
||||
'PhabricatorMySQLSetupCheck' => 'PhabricatorSetupCheck',
|
||||
'PhabricatorNamedQuery' => array(
|
||||
'PhabricatorSearchDAO',
|
||||
|
@ -7399,7 +7400,6 @@ phutil_register_library_map(array(
|
|||
'PhabricatorSearchDocumentRelationship' => 'PhabricatorSearchDAO',
|
||||
'PhabricatorSearchDocumentTypeDatasource' => 'PhabricatorTypeaheadDatasource',
|
||||
'PhabricatorSearchEditController' => 'PhabricatorSearchBaseController',
|
||||
'PhabricatorSearchEngine' => 'Phobject',
|
||||
'PhabricatorSearchEngineAPIMethod' => 'ConduitAPIMethod',
|
||||
'PhabricatorSearchEngineAttachment' => 'Phobject',
|
||||
'PhabricatorSearchEngineExtension' => 'Phobject',
|
||||
|
|
|
@ -11,7 +11,7 @@ final class PhabricatorElasticSearchSetupCheck extends PhabricatorSetupCheck {
|
|||
return;
|
||||
}
|
||||
|
||||
$engine = new PhabricatorElasticSearchEngine();
|
||||
$engine = new PhabricatorElasticFulltextStorageEngine();
|
||||
|
||||
$index_exists = null;
|
||||
$index_sane = null;
|
||||
|
@ -70,8 +70,8 @@ final class PhabricatorElasticSearchSetupCheck extends PhabricatorSetupCheck {
|
|||
}
|
||||
|
||||
protected function shouldUseElasticSearchEngine() {
|
||||
$search_engine = PhabricatorSearchEngine::loadEngine();
|
||||
return ($search_engine instanceof PhabricatorElasticSearchEngine);
|
||||
$search_engine = PhabricatorFulltextStorageEngine::loadEngine();
|
||||
return ($search_engine instanceof PhabricatorElasticFulltextStorageEngine);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -366,8 +366,8 @@ final class PhabricatorMySQLSetupCheck extends PhabricatorSetupCheck {
|
|||
}
|
||||
|
||||
protected function shouldUseMySQLSearchEngine() {
|
||||
$search_engine = PhabricatorSearchEngine::loadEngine();
|
||||
return $search_engine instanceof PhabricatorMySQLSearchEngine;
|
||||
$search_engine = PhabricatorFulltextStorageEngine::loadEngine();
|
||||
return ($search_engine instanceof PhabricatorMySQLFulltextStorageEngine);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -499,7 +499,7 @@ final class ManiphestTaskQuery extends PhabricatorCursorPagedPolicyAwareQuery {
|
|||
$fulltext_query->setParameter('types',
|
||||
array(ManiphestTaskPHIDType::TYPECONST));
|
||||
|
||||
$engine = PhabricatorSearchEngine::loadEngine();
|
||||
$engine = PhabricatorFulltextStorageEngine::loadEngine();
|
||||
$fulltext_results = $engine->executeSearch($fulltext_query);
|
||||
|
||||
if (empty($fulltext_results)) {
|
||||
|
|
|
@ -16,8 +16,8 @@ final class PhabricatorSearchApplicationStorageEnginePanel
|
|||
$viewer = $this->getViewer();
|
||||
$application = $this->getApplication();
|
||||
|
||||
$active_engine = PhabricatorSearchEngine::loadEngine();
|
||||
$engines = PhabricatorSearchEngine::loadAllEngines();
|
||||
$active_engine = PhabricatorFulltextStorageEngine::loadEngine();
|
||||
$engines = PhabricatorFulltextStorageEngine::loadAllEngines();
|
||||
|
||||
$rows = array();
|
||||
$rowc = array();
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
final class PhabricatorSearchEngineTestCase extends PhabricatorTestCase {
|
||||
|
||||
public function testLoadAllEngines() {
|
||||
PhabricatorSearchEngine::loadAllEngines();
|
||||
PhabricatorFulltextStorageEngine::loadAllEngines();
|
||||
$this->assertTrue(true);
|
||||
}
|
||||
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
<?php
|
||||
|
||||
final class PhabricatorElasticSearchEngine extends PhabricatorSearchEngine {
|
||||
final class PhabricatorElasticFulltextStorageEngine
|
||||
extends PhabricatorFulltextStorageEngine {
|
||||
|
||||
private $uri;
|
||||
private $index;
|
|
@ -5,7 +5,7 @@
|
|||
* three capabilities: indexing, searching, and reconstruction (this can be
|
||||
* stubbed out if an engine can't reasonably do it, it is used for debugging).
|
||||
*/
|
||||
abstract class PhabricatorSearchEngine extends Phobject {
|
||||
abstract class PhabricatorFulltextStorageEngine extends Phobject {
|
||||
|
||||
/* -( Engine Metadata )---------------------------------------------------- */
|
||||
|
|
@ -1,6 +1,7 @@
|
|||
<?php
|
||||
|
||||
final class PhabricatorMySQLSearchEngine extends PhabricatorSearchEngine {
|
||||
final class PhabricatorMySQLFulltextStorageEngine
|
||||
extends PhabricatorFulltextStorageEngine {
|
||||
|
||||
public function getEngineIdentifier() {
|
||||
return 'mysql';
|
|
@ -40,7 +40,7 @@ abstract class PhabricatorFulltextEngine
|
|||
$extension->indexFulltextObject($object, $document);
|
||||
}
|
||||
|
||||
$storage_engine = PhabricatorSearchEngine::loadEngine();
|
||||
$storage_engine = PhabricatorFulltextStorageEngine::loadEngine();
|
||||
$storage_engine->reindexAbstractDocument($document);
|
||||
}
|
||||
|
||||
|
|
|
@ -13,7 +13,7 @@ final class PhabricatorSearchManagementInitWorkflow
|
|||
public function execute(PhutilArgumentParser $args) {
|
||||
$console = PhutilConsole::getConsole();
|
||||
|
||||
$engine = PhabricatorSearchEngine::loadEngine();
|
||||
$engine = PhabricatorFulltextStorageEngine::loadEngine();
|
||||
|
||||
$work_done = false;
|
||||
if (!$engine->indexExists()) {
|
||||
|
|
|
@ -74,7 +74,7 @@ final class PhabricatorSearchDocumentQuery
|
|||
->setParameter('offset', $this->getOffset())
|
||||
->setParameter('limit', $this->getRawResultLimit());
|
||||
|
||||
$engine = PhabricatorSearchEngine::loadEngine();
|
||||
$engine = PhabricatorFulltextStorageEngine::loadEngine();
|
||||
|
||||
return $engine->executeSearch($query);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue