1
0
Fork 0
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:
epriestley 2015-12-21 10:25:28 -08:00
parent 99c9df96b4
commit 23c42486e4
12 changed files with 23 additions and 21 deletions

View file

@ -2194,7 +2194,7 @@ phutil_register_library_map(array(
'PhabricatorEditField' => 'applications/transactions/editfield/PhabricatorEditField.php', 'PhabricatorEditField' => 'applications/transactions/editfield/PhabricatorEditField.php',
'PhabricatorEditType' => 'applications/transactions/edittype/PhabricatorEditType.php', 'PhabricatorEditType' => 'applications/transactions/edittype/PhabricatorEditType.php',
'PhabricatorEditor' => 'infrastructure/PhabricatorEditor.php', 'PhabricatorEditor' => 'infrastructure/PhabricatorEditor.php',
'PhabricatorElasticSearchEngine' => 'applications/search/engine/PhabricatorElasticSearchEngine.php', 'PhabricatorElasticFulltextStorageEngine' => 'applications/search/fulltextstorage/PhabricatorElasticFulltextStorageEngine.php',
'PhabricatorElasticSearchSetupCheck' => 'applications/config/check/PhabricatorElasticSearchSetupCheck.php', 'PhabricatorElasticSearchSetupCheck' => 'applications/config/check/PhabricatorElasticSearchSetupCheck.php',
'PhabricatorEmailAddressesSettingsPanel' => 'applications/settings/panel/PhabricatorEmailAddressesSettingsPanel.php', 'PhabricatorEmailAddressesSettingsPanel' => 'applications/settings/panel/PhabricatorEmailAddressesSettingsPanel.php',
'PhabricatorEmailFormatSettingsPanel' => 'applications/settings/panel/PhabricatorEmailFormatSettingsPanel.php', 'PhabricatorEmailFormatSettingsPanel' => 'applications/settings/panel/PhabricatorEmailFormatSettingsPanel.php',
@ -2333,6 +2333,7 @@ phutil_register_library_map(array(
'PhabricatorFulltextEngineExtensionModule' => 'applications/search/index/PhabricatorFulltextEngineExtensionModule.php', 'PhabricatorFulltextEngineExtensionModule' => 'applications/search/index/PhabricatorFulltextEngineExtensionModule.php',
'PhabricatorFulltextIndexEngineExtension' => 'applications/search/engineextension/PhabricatorFulltextIndexEngineExtension.php', 'PhabricatorFulltextIndexEngineExtension' => 'applications/search/engineextension/PhabricatorFulltextIndexEngineExtension.php',
'PhabricatorFulltextInterface' => 'applications/search/interface/PhabricatorFulltextInterface.php', 'PhabricatorFulltextInterface' => 'applications/search/interface/PhabricatorFulltextInterface.php',
'PhabricatorFulltextStorageEngine' => 'applications/search/fulltextstorage/PhabricatorFulltextStorageEngine.php',
'PhabricatorFundApplication' => 'applications/fund/application/PhabricatorFundApplication.php', 'PhabricatorFundApplication' => 'applications/fund/application/PhabricatorFundApplication.php',
'PhabricatorGDSetupCheck' => 'applications/config/check/PhabricatorGDSetupCheck.php', 'PhabricatorGDSetupCheck' => 'applications/config/check/PhabricatorGDSetupCheck.php',
'PhabricatorGarbageCollector' => 'infrastructure/daemon/garbagecollector/PhabricatorGarbageCollector.php', 'PhabricatorGarbageCollector' => 'infrastructure/daemon/garbagecollector/PhabricatorGarbageCollector.php',
@ -2541,7 +2542,7 @@ phutil_register_library_map(array(
'PhabricatorMustVerifyEmailController' => 'applications/auth/controller/PhabricatorMustVerifyEmailController.php', 'PhabricatorMustVerifyEmailController' => 'applications/auth/controller/PhabricatorMustVerifyEmailController.php',
'PhabricatorMySQLConfigOptions' => 'applications/config/option/PhabricatorMySQLConfigOptions.php', 'PhabricatorMySQLConfigOptions' => 'applications/config/option/PhabricatorMySQLConfigOptions.php',
'PhabricatorMySQLFileStorageEngine' => 'applications/files/engine/PhabricatorMySQLFileStorageEngine.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', 'PhabricatorMySQLSetupCheck' => 'applications/config/check/PhabricatorMySQLSetupCheck.php',
'PhabricatorNamedQuery' => 'applications/search/storage/PhabricatorNamedQuery.php', 'PhabricatorNamedQuery' => 'applications/search/storage/PhabricatorNamedQuery.php',
'PhabricatorNamedQueryQuery' => 'applications/search/query/PhabricatorNamedQueryQuery.php', 'PhabricatorNamedQueryQuery' => 'applications/search/query/PhabricatorNamedQueryQuery.php',
@ -3034,7 +3035,6 @@ phutil_register_library_map(array(
'PhabricatorSearchDocumentRelationship' => 'applications/search/storage/document/PhabricatorSearchDocumentRelationship.php', 'PhabricatorSearchDocumentRelationship' => 'applications/search/storage/document/PhabricatorSearchDocumentRelationship.php',
'PhabricatorSearchDocumentTypeDatasource' => 'applications/search/typeahead/PhabricatorSearchDocumentTypeDatasource.php', 'PhabricatorSearchDocumentTypeDatasource' => 'applications/search/typeahead/PhabricatorSearchDocumentTypeDatasource.php',
'PhabricatorSearchEditController' => 'applications/search/controller/PhabricatorSearchEditController.php', 'PhabricatorSearchEditController' => 'applications/search/controller/PhabricatorSearchEditController.php',
'PhabricatorSearchEngine' => 'applications/search/engine/PhabricatorSearchEngine.php',
'PhabricatorSearchEngineAPIMethod' => 'applications/search/engine/PhabricatorSearchEngineAPIMethod.php', 'PhabricatorSearchEngineAPIMethod' => 'applications/search/engine/PhabricatorSearchEngineAPIMethod.php',
'PhabricatorSearchEngineAttachment' => 'applications/search/engineextension/PhabricatorSearchEngineAttachment.php', 'PhabricatorSearchEngineAttachment' => 'applications/search/engineextension/PhabricatorSearchEngineAttachment.php',
'PhabricatorSearchEngineExtension' => 'applications/search/engineextension/PhabricatorSearchEngineExtension.php', 'PhabricatorSearchEngineExtension' => 'applications/search/engineextension/PhabricatorSearchEngineExtension.php',
@ -6398,7 +6398,7 @@ phutil_register_library_map(array(
'PhabricatorEditField' => 'Phobject', 'PhabricatorEditField' => 'Phobject',
'PhabricatorEditType' => 'Phobject', 'PhabricatorEditType' => 'Phobject',
'PhabricatorEditor' => 'Phobject', 'PhabricatorEditor' => 'Phobject',
'PhabricatorElasticSearchEngine' => 'PhabricatorSearchEngine', 'PhabricatorElasticFulltextStorageEngine' => 'PhabricatorFulltextStorageEngine',
'PhabricatorElasticSearchSetupCheck' => 'PhabricatorSetupCheck', 'PhabricatorElasticSearchSetupCheck' => 'PhabricatorSetupCheck',
'PhabricatorEmailAddressesSettingsPanel' => 'PhabricatorSettingsPanel', 'PhabricatorEmailAddressesSettingsPanel' => 'PhabricatorSettingsPanel',
'PhabricatorEmailFormatSettingsPanel' => 'PhabricatorSettingsPanel', 'PhabricatorEmailFormatSettingsPanel' => 'PhabricatorSettingsPanel',
@ -6567,6 +6567,7 @@ phutil_register_library_map(array(
'PhabricatorFulltextEngineExtension' => 'Phobject', 'PhabricatorFulltextEngineExtension' => 'Phobject',
'PhabricatorFulltextEngineExtensionModule' => 'PhabricatorConfigModule', 'PhabricatorFulltextEngineExtensionModule' => 'PhabricatorConfigModule',
'PhabricatorFulltextIndexEngineExtension' => 'PhabricatorIndexEngineExtension', 'PhabricatorFulltextIndexEngineExtension' => 'PhabricatorIndexEngineExtension',
'PhabricatorFulltextStorageEngine' => 'Phobject',
'PhabricatorFundApplication' => 'PhabricatorApplication', 'PhabricatorFundApplication' => 'PhabricatorApplication',
'PhabricatorGDSetupCheck' => 'PhabricatorSetupCheck', 'PhabricatorGDSetupCheck' => 'PhabricatorSetupCheck',
'PhabricatorGarbageCollector' => 'Phobject', 'PhabricatorGarbageCollector' => 'Phobject',
@ -6790,7 +6791,7 @@ phutil_register_library_map(array(
'PhabricatorMustVerifyEmailController' => 'PhabricatorAuthController', 'PhabricatorMustVerifyEmailController' => 'PhabricatorAuthController',
'PhabricatorMySQLConfigOptions' => 'PhabricatorApplicationConfigOptions', 'PhabricatorMySQLConfigOptions' => 'PhabricatorApplicationConfigOptions',
'PhabricatorMySQLFileStorageEngine' => 'PhabricatorFileStorageEngine', 'PhabricatorMySQLFileStorageEngine' => 'PhabricatorFileStorageEngine',
'PhabricatorMySQLSearchEngine' => 'PhabricatorSearchEngine', 'PhabricatorMySQLFulltextStorageEngine' => 'PhabricatorFulltextStorageEngine',
'PhabricatorMySQLSetupCheck' => 'PhabricatorSetupCheck', 'PhabricatorMySQLSetupCheck' => 'PhabricatorSetupCheck',
'PhabricatorNamedQuery' => array( 'PhabricatorNamedQuery' => array(
'PhabricatorSearchDAO', 'PhabricatorSearchDAO',
@ -7399,7 +7400,6 @@ phutil_register_library_map(array(
'PhabricatorSearchDocumentRelationship' => 'PhabricatorSearchDAO', 'PhabricatorSearchDocumentRelationship' => 'PhabricatorSearchDAO',
'PhabricatorSearchDocumentTypeDatasource' => 'PhabricatorTypeaheadDatasource', 'PhabricatorSearchDocumentTypeDatasource' => 'PhabricatorTypeaheadDatasource',
'PhabricatorSearchEditController' => 'PhabricatorSearchBaseController', 'PhabricatorSearchEditController' => 'PhabricatorSearchBaseController',
'PhabricatorSearchEngine' => 'Phobject',
'PhabricatorSearchEngineAPIMethod' => 'ConduitAPIMethod', 'PhabricatorSearchEngineAPIMethod' => 'ConduitAPIMethod',
'PhabricatorSearchEngineAttachment' => 'Phobject', 'PhabricatorSearchEngineAttachment' => 'Phobject',
'PhabricatorSearchEngineExtension' => 'Phobject', 'PhabricatorSearchEngineExtension' => 'Phobject',

View file

@ -11,7 +11,7 @@ final class PhabricatorElasticSearchSetupCheck extends PhabricatorSetupCheck {
return; return;
} }
$engine = new PhabricatorElasticSearchEngine(); $engine = new PhabricatorElasticFulltextStorageEngine();
$index_exists = null; $index_exists = null;
$index_sane = null; $index_sane = null;
@ -70,8 +70,8 @@ final class PhabricatorElasticSearchSetupCheck extends PhabricatorSetupCheck {
} }
protected function shouldUseElasticSearchEngine() { protected function shouldUseElasticSearchEngine() {
$search_engine = PhabricatorSearchEngine::loadEngine(); $search_engine = PhabricatorFulltextStorageEngine::loadEngine();
return ($search_engine instanceof PhabricatorElasticSearchEngine); return ($search_engine instanceof PhabricatorElasticFulltextStorageEngine);
} }
} }

View file

@ -366,8 +366,8 @@ final class PhabricatorMySQLSetupCheck extends PhabricatorSetupCheck {
} }
protected function shouldUseMySQLSearchEngine() { protected function shouldUseMySQLSearchEngine() {
$search_engine = PhabricatorSearchEngine::loadEngine(); $search_engine = PhabricatorFulltextStorageEngine::loadEngine();
return $search_engine instanceof PhabricatorMySQLSearchEngine; return ($search_engine instanceof PhabricatorMySQLFulltextStorageEngine);
} }
} }

View file

@ -499,7 +499,7 @@ final class ManiphestTaskQuery extends PhabricatorCursorPagedPolicyAwareQuery {
$fulltext_query->setParameter('types', $fulltext_query->setParameter('types',
array(ManiphestTaskPHIDType::TYPECONST)); array(ManiphestTaskPHIDType::TYPECONST));
$engine = PhabricatorSearchEngine::loadEngine(); $engine = PhabricatorFulltextStorageEngine::loadEngine();
$fulltext_results = $engine->executeSearch($fulltext_query); $fulltext_results = $engine->executeSearch($fulltext_query);
if (empty($fulltext_results)) { if (empty($fulltext_results)) {

View file

@ -16,8 +16,8 @@ final class PhabricatorSearchApplicationStorageEnginePanel
$viewer = $this->getViewer(); $viewer = $this->getViewer();
$application = $this->getApplication(); $application = $this->getApplication();
$active_engine = PhabricatorSearchEngine::loadEngine(); $active_engine = PhabricatorFulltextStorageEngine::loadEngine();
$engines = PhabricatorSearchEngine::loadAllEngines(); $engines = PhabricatorFulltextStorageEngine::loadAllEngines();
$rows = array(); $rows = array();
$rowc = array(); $rowc = array();

View file

@ -3,7 +3,7 @@
final class PhabricatorSearchEngineTestCase extends PhabricatorTestCase { final class PhabricatorSearchEngineTestCase extends PhabricatorTestCase {
public function testLoadAllEngines() { public function testLoadAllEngines() {
PhabricatorSearchEngine::loadAllEngines(); PhabricatorFulltextStorageEngine::loadAllEngines();
$this->assertTrue(true); $this->assertTrue(true);
} }

View file

@ -1,6 +1,7 @@
<?php <?php
final class PhabricatorElasticSearchEngine extends PhabricatorSearchEngine { final class PhabricatorElasticFulltextStorageEngine
extends PhabricatorFulltextStorageEngine {
private $uri; private $uri;
private $index; private $index;

View file

@ -5,7 +5,7 @@
* three capabilities: indexing, searching, and reconstruction (this can be * three capabilities: indexing, searching, and reconstruction (this can be
* stubbed out if an engine can't reasonably do it, it is used for debugging). * 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 )---------------------------------------------------- */ /* -( Engine Metadata )---------------------------------------------------- */

View file

@ -1,6 +1,7 @@
<?php <?php
final class PhabricatorMySQLSearchEngine extends PhabricatorSearchEngine { final class PhabricatorMySQLFulltextStorageEngine
extends PhabricatorFulltextStorageEngine {
public function getEngineIdentifier() { public function getEngineIdentifier() {
return 'mysql'; return 'mysql';

View file

@ -40,7 +40,7 @@ abstract class PhabricatorFulltextEngine
$extension->indexFulltextObject($object, $document); $extension->indexFulltextObject($object, $document);
} }
$storage_engine = PhabricatorSearchEngine::loadEngine(); $storage_engine = PhabricatorFulltextStorageEngine::loadEngine();
$storage_engine->reindexAbstractDocument($document); $storage_engine->reindexAbstractDocument($document);
} }

View file

@ -13,7 +13,7 @@ final class PhabricatorSearchManagementInitWorkflow
public function execute(PhutilArgumentParser $args) { public function execute(PhutilArgumentParser $args) {
$console = PhutilConsole::getConsole(); $console = PhutilConsole::getConsole();
$engine = PhabricatorSearchEngine::loadEngine(); $engine = PhabricatorFulltextStorageEngine::loadEngine();
$work_done = false; $work_done = false;
if (!$engine->indexExists()) { if (!$engine->indexExists()) {

View file

@ -74,7 +74,7 @@ final class PhabricatorSearchDocumentQuery
->setParameter('offset', $this->getOffset()) ->setParameter('offset', $this->getOffset())
->setParameter('limit', $this->getRawResultLimit()); ->setParameter('limit', $this->getRawResultLimit());
$engine = PhabricatorSearchEngine::loadEngine(); $engine = PhabricatorFulltextStorageEngine::loadEngine();
return $engine->executeSearch($query); return $engine->executeSearch($query);
} }