diff --git a/src/__phutil_library_map__.php b/src/__phutil_library_map__.php index 0a1602c2c6..2aaf3db60b 100644 --- a/src/__phutil_library_map__.php +++ b/src/__phutil_library_map__.php @@ -482,6 +482,7 @@ phutil_register_library_map(array( 'DifferentialRevisionDependsOnRevisionEdgeType' => 'applications/differential/edge/DifferentialRevisionDependsOnRevisionEdgeType.php', 'DifferentialRevisionDetailView' => 'applications/differential/view/DifferentialRevisionDetailView.php', 'DifferentialRevisionEditController' => 'applications/differential/controller/DifferentialRevisionEditController.php', + 'DifferentialRevisionFulltextEngine' => 'applications/differential/search/DifferentialRevisionFulltextEngine.php', 'DifferentialRevisionHasCommitEdgeType' => 'applications/differential/edge/DifferentialRevisionHasCommitEdgeType.php', 'DifferentialRevisionHasReviewerEdgeType' => 'applications/differential/edge/DifferentialRevisionHasReviewerEdgeType.php', 'DifferentialRevisionHasTaskEdgeType' => 'applications/differential/edge/DifferentialRevisionHasTaskEdgeType.php', @@ -507,7 +508,6 @@ phutil_register_library_map(array( 'DifferentialRevisionUpdateHistoryView' => 'applications/differential/view/DifferentialRevisionUpdateHistoryView.php', 'DifferentialRevisionViewController' => 'applications/differential/controller/DifferentialRevisionViewController.php', 'DifferentialSchemaSpec' => 'applications/differential/storage/DifferentialSchemaSpec.php', - 'DifferentialSearchIndexer' => 'applications/differential/search/DifferentialSearchIndexer.php', 'DifferentialSetDiffPropertyConduitAPIMethod' => 'applications/differential/conduit/DifferentialSetDiffPropertyConduitAPIMethod.php', 'DifferentialStoredCustomField' => 'applications/differential/customfield/DifferentialStoredCustomField.php', 'DifferentialSubscribersField' => 'applications/differential/customfield/DifferentialSubscribersField.php', @@ -556,6 +556,7 @@ phutil_register_library_map(array( 'DiffusionCommitDiffContentRemovedHeraldField' => 'applications/diffusion/herald/DiffusionCommitDiffContentRemovedHeraldField.php', 'DiffusionCommitDiffEnormousHeraldField' => 'applications/diffusion/herald/DiffusionCommitDiffEnormousHeraldField.php', 'DiffusionCommitEditController' => 'applications/diffusion/controller/DiffusionCommitEditController.php', + 'DiffusionCommitFulltextEngine' => 'applications/repository/search/DiffusionCommitFulltextEngine.php', 'DiffusionCommitHasRevisionEdgeType' => 'applications/diffusion/edge/DiffusionCommitHasRevisionEdgeType.php', 'DiffusionCommitHasTaskEdgeType' => 'applications/diffusion/edge/DiffusionCommitHasTaskEdgeType.php', 'DiffusionCommitHash' => 'applications/diffusion/data/DiffusionCommitHash.php', @@ -770,7 +771,6 @@ phutil_register_library_map(array( 'DivinerAtomQuery' => 'applications/diviner/query/DivinerAtomQuery.php', 'DivinerAtomRef' => 'applications/diviner/atom/DivinerAtomRef.php', 'DivinerAtomSearchEngine' => 'applications/diviner/query/DivinerAtomSearchEngine.php', - 'DivinerAtomSearchIndexer' => 'applications/diviner/search/DivinerAtomSearchIndexer.php', 'DivinerAtomizeWorkflow' => 'applications/diviner/workflow/DivinerAtomizeWorkflow.php', 'DivinerAtomizer' => 'applications/diviner/atomizer/DivinerAtomizer.php', 'DivinerBookController' => 'applications/diviner/controller/DivinerBookController.php', @@ -779,7 +779,6 @@ phutil_register_library_map(array( 'DivinerBookItemView' => 'applications/diviner/view/DivinerBookItemView.php', 'DivinerBookPHIDType' => 'applications/diviner/phid/DivinerBookPHIDType.php', 'DivinerBookQuery' => 'applications/diviner/query/DivinerBookQuery.php', - 'DivinerBookSearchIndexer' => 'applications/diviner/search/DivinerBookSearchIndexer.php', 'DivinerController' => 'applications/diviner/controller/DivinerController.php', 'DivinerDAO' => 'applications/diviner/storage/DivinerDAO.php', 'DivinerDefaultEditCapability' => 'applications/diviner/capability/DivinerDefaultEditCapability.php', @@ -792,10 +791,12 @@ phutil_register_library_map(array( 'DivinerLiveAtom' => 'applications/diviner/storage/DivinerLiveAtom.php', 'DivinerLiveBook' => 'applications/diviner/storage/DivinerLiveBook.php', 'DivinerLiveBookEditor' => 'applications/diviner/editor/DivinerLiveBookEditor.php', + 'DivinerLiveBookFulltextEngine' => 'applications/diviner/search/DivinerLiveBookFulltextEngine.php', 'DivinerLiveBookTransaction' => 'applications/diviner/storage/DivinerLiveBookTransaction.php', 'DivinerLiveBookTransactionQuery' => 'applications/diviner/query/DivinerLiveBookTransactionQuery.php', 'DivinerLivePublisher' => 'applications/diviner/publisher/DivinerLivePublisher.php', 'DivinerLiveSymbol' => 'applications/diviner/storage/DivinerLiveSymbol.php', + 'DivinerLiveSymbolFulltextEngine' => 'applications/diviner/search/DivinerLiveSymbolFulltextEngine.php', 'DivinerMainController' => 'applications/diviner/controller/DivinerMainController.php', 'DivinerPHPAtomizer' => 'applications/diviner/atomizer/DivinerPHPAtomizer.php', 'DivinerParameterTableView' => 'applications/diviner/view/DivinerParameterTableView.php', @@ -986,7 +987,7 @@ phutil_register_library_map(array( 'FundInitiativeCloseController' => 'applications/fund/controller/FundInitiativeCloseController.php', 'FundInitiativeEditController' => 'applications/fund/controller/FundInitiativeEditController.php', 'FundInitiativeEditor' => 'applications/fund/editor/FundInitiativeEditor.php', - 'FundInitiativeIndexer' => 'applications/fund/search/FundInitiativeIndexer.php', + 'FundInitiativeFulltextEngine' => 'applications/fund/search/FundInitiativeFulltextEngine.php', 'FundInitiativeListController' => 'applications/fund/controller/FundInitiativeListController.php', 'FundInitiativePHIDType' => 'applications/fund/phid/FundInitiativePHIDType.php', 'FundInitiativeQuery' => 'applications/fund/query/FundInitiativeQuery.php', @@ -1304,7 +1305,6 @@ phutil_register_library_map(array( 'ManiphestReportController' => 'applications/maniphest/controller/ManiphestReportController.php', 'ManiphestSchemaSpec' => 'applications/maniphest/storage/ManiphestSchemaSpec.php', 'ManiphestSearchConduitAPIMethod' => 'applications/maniphest/conduit/ManiphestSearchConduitAPIMethod.php', - 'ManiphestSearchIndexer' => 'applications/maniphest/search/ManiphestSearchIndexer.php', 'ManiphestStatusConfigOptionType' => 'applications/maniphest/config/ManiphestStatusConfigOptionType.php', 'ManiphestStatusEmailCommand' => 'applications/maniphest/command/ManiphestStatusEmailCommand.php', 'ManiphestSubpriorityController' => 'applications/maniphest/controller/ManiphestSubpriorityController.php', @@ -1322,6 +1322,7 @@ phutil_register_library_map(array( 'ManiphestTaskDetailController' => 'applications/maniphest/controller/ManiphestTaskDetailController.php', 'ManiphestTaskEditBulkJobType' => 'applications/maniphest/bulk/ManiphestTaskEditBulkJobType.php', 'ManiphestTaskEditController' => 'applications/maniphest/controller/ManiphestTaskEditController.php', + 'ManiphestTaskFulltextEngine' => 'applications/maniphest/search/ManiphestTaskFulltextEngine.php', 'ManiphestTaskHasCommitEdgeType' => 'applications/maniphest/edge/ManiphestTaskHasCommitEdgeType.php', 'ManiphestTaskHasMockEdgeType' => 'applications/maniphest/edge/ManiphestTaskHasMockEdgeType.php', 'ManiphestTaskHasRevisionEdgeType' => 'applications/maniphest/edge/ManiphestTaskHasRevisionEdgeType.php', @@ -1537,6 +1538,7 @@ phutil_register_library_map(array( 'PassphraseCredentialCreateController' => 'applications/passphrase/controller/PassphraseCredentialCreateController.php', 'PassphraseCredentialDestroyController' => 'applications/passphrase/controller/PassphraseCredentialDestroyController.php', 'PassphraseCredentialEditController' => 'applications/passphrase/controller/PassphraseCredentialEditController.php', + 'PassphraseCredentialFulltextEngine' => 'applications/passphrase/search/PassphraseCredentialFulltextEngine.php', 'PassphraseCredentialListController' => 'applications/passphrase/controller/PassphraseCredentialListController.php', 'PassphraseCredentialLockController' => 'applications/passphrase/controller/PassphraseCredentialLockController.php', 'PassphraseCredentialPHIDType' => 'applications/passphrase/phid/PassphraseCredentialPHIDType.php', @@ -1564,7 +1566,6 @@ phutil_register_library_map(array( 'PassphraseSSHPrivateKeyFileCredentialType' => 'applications/passphrase/credentialtype/PassphraseSSHPrivateKeyFileCredentialType.php', 'PassphraseSSHPrivateKeyTextCredentialType' => 'applications/passphrase/credentialtype/PassphraseSSHPrivateKeyTextCredentialType.php', 'PassphraseSchemaSpec' => 'applications/passphrase/storage/PassphraseSchemaSpec.php', - 'PassphraseSearchIndexer' => 'applications/passphrase/search/PassphraseSearchIndexer.php', 'PassphraseSecret' => 'applications/passphrase/storage/PassphraseSecret.php', 'PasteConduitAPIMethod' => 'applications/paste/conduit/PasteConduitAPIMethod.php', 'PasteCreateConduitAPIMethod' => 'applications/paste/conduit/PasteCreateConduitAPIMethod.php', @@ -1841,6 +1842,7 @@ phutil_register_library_map(array( 'PhabricatorCalendarEventEditController' => 'applications/calendar/controller/PhabricatorCalendarEventEditController.php', 'PhabricatorCalendarEventEditor' => 'applications/calendar/editor/PhabricatorCalendarEventEditor.php', 'PhabricatorCalendarEventEmailCommand' => 'applications/calendar/command/PhabricatorCalendarEventEmailCommand.php', + 'PhabricatorCalendarEventFulltextEngine' => 'applications/calendar/search/PhabricatorCalendarEventFulltextEngine.php', 'PhabricatorCalendarEventInvitee' => 'applications/calendar/storage/PhabricatorCalendarEventInvitee.php', 'PhabricatorCalendarEventInviteeQuery' => 'applications/calendar/query/PhabricatorCalendarEventInviteeQuery.php', 'PhabricatorCalendarEventJoinController' => 'applications/calendar/controller/PhabricatorCalendarEventJoinController.php', @@ -1850,7 +1852,6 @@ phutil_register_library_map(array( 'PhabricatorCalendarEventQuery' => 'applications/calendar/query/PhabricatorCalendarEventQuery.php', 'PhabricatorCalendarEventRSVPEmailCommand' => 'applications/calendar/command/PhabricatorCalendarEventRSVPEmailCommand.php', 'PhabricatorCalendarEventSearchEngine' => 'applications/calendar/query/PhabricatorCalendarEventSearchEngine.php', - 'PhabricatorCalendarEventSearchIndexer' => 'applications/calendar/search/PhabricatorCalendarEventSearchIndexer.php', 'PhabricatorCalendarEventTransaction' => 'applications/calendar/storage/PhabricatorCalendarEventTransaction.php', 'PhabricatorCalendarEventTransactionComment' => 'applications/calendar/storage/PhabricatorCalendarEventTransactionComment.php', 'PhabricatorCalendarEventTransactionQuery' => 'applications/calendar/query/PhabricatorCalendarEventTransactionQuery.php', @@ -2327,8 +2328,11 @@ phutil_register_library_map(array( 'PhabricatorFlaggableInterface' => 'applications/flag/interface/PhabricatorFlaggableInterface.php', 'PhabricatorFlagsApplication' => 'applications/flag/application/PhabricatorFlagsApplication.php', 'PhabricatorFlagsUIEventListener' => 'applications/flag/events/PhabricatorFlagsUIEventListener.php', + 'PhabricatorFulltextEngine' => 'applications/search/index/PhabricatorFulltextEngine.php', 'PhabricatorFulltextEngineExtension' => 'applications/search/index/PhabricatorFulltextEngineExtension.php', 'PhabricatorFulltextEngineExtensionModule' => 'applications/search/index/PhabricatorFulltextEngineExtensionModule.php', + 'PhabricatorFulltextIndexEngineExtension' => 'applications/search/engineextension/PhabricatorFulltextIndexEngineExtension.php', + 'PhabricatorFulltextInterface' => 'applications/search/interface/PhabricatorFulltextInterface.php', 'PhabricatorFundApplication' => 'applications/fund/application/PhabricatorFundApplication.php', 'PhabricatorGDSetupCheck' => 'applications/config/check/PhabricatorGDSetupCheck.php', 'PhabricatorGarbageCollector' => 'infrastructure/daemon/garbagecollector/PhabricatorGarbageCollector.php', @@ -2407,6 +2411,7 @@ phutil_register_library_map(array( 'PhabricatorLipsumManagementWorkflow' => 'applications/lipsum/management/PhabricatorLipsumManagementWorkflow.php', 'PhabricatorLipsumMondrianArtist' => 'applications/lipsum/image/PhabricatorLipsumMondrianArtist.php', 'PhabricatorLiskDAO' => 'infrastructure/storage/lisk/PhabricatorLiskDAO.php', + 'PhabricatorLiskFulltextEngineExtension' => 'applications/search/engineextension/PhabricatorLiskFulltextEngineExtension.php', 'PhabricatorLiskSearchEngineExtension' => 'applications/search/engineextension/PhabricatorLiskSearchEngineExtension.php', 'PhabricatorLiskSerializer' => 'infrastructure/storage/lisk/PhabricatorLiskSerializer.php', 'PhabricatorListFilterUIExample' => 'applications/uiexample/examples/PhabricatorListFilterUIExample.php', @@ -2832,6 +2837,7 @@ phutil_register_library_map(array( 'PhabricatorProjectEditPictureController' => 'applications/project/controller/PhabricatorProjectEditPictureController.php', 'PhabricatorProjectEditorTestCase' => 'applications/project/editor/__tests__/PhabricatorProjectEditorTestCase.php', 'PhabricatorProjectFeedController' => 'applications/project/controller/PhabricatorProjectFeedController.php', + 'PhabricatorProjectFulltextEngine' => 'applications/project/search/PhabricatorProjectFulltextEngine.php', 'PhabricatorProjectHeraldAction' => 'applications/project/herald/PhabricatorProjectHeraldAction.php', 'PhabricatorProjectIconSet' => 'applications/project/icon/PhabricatorProjectIconSet.php', 'PhabricatorProjectInterface' => 'applications/project/interface/PhabricatorProjectInterface.php', @@ -2860,7 +2866,6 @@ phutil_register_library_map(array( 'PhabricatorProjectSchemaSpec' => 'applications/project/storage/PhabricatorProjectSchemaSpec.php', 'PhabricatorProjectSearchEngine' => 'applications/project/query/PhabricatorProjectSearchEngine.php', 'PhabricatorProjectSearchField' => 'applications/project/searchfield/PhabricatorProjectSearchField.php', - 'PhabricatorProjectSearchIndexer' => 'applications/project/search/PhabricatorProjectSearchIndexer.php', 'PhabricatorProjectSlug' => 'applications/project/storage/PhabricatorProjectSlug.php', 'PhabricatorProjectStandardCustomField' => 'applications/project/customfield/PhabricatorProjectStandardCustomField.php', 'PhabricatorProjectStatus' => 'applications/project/constants/PhabricatorProjectStatus.php', @@ -2914,7 +2919,6 @@ phutil_register_library_map(array( 'PhabricatorRepositoryCommitPHIDType' => 'applications/repository/phid/PhabricatorRepositoryCommitPHIDType.php', 'PhabricatorRepositoryCommitParserWorker' => 'applications/repository/worker/PhabricatorRepositoryCommitParserWorker.php', 'PhabricatorRepositoryCommitRef' => 'applications/repository/engine/PhabricatorRepositoryCommitRef.php', - 'PhabricatorRepositoryCommitSearchIndexer' => 'applications/repository/search/PhabricatorRepositoryCommitSearchIndexer.php', 'PhabricatorRepositoryConfigOptions' => 'applications/repository/config/PhabricatorRepositoryConfigOptions.php', 'PhabricatorRepositoryDAO' => 'applications/repository/storage/PhabricatorRepositoryDAO.php', 'PhabricatorRepositoryDiscoveryEngine' => 'applications/repository/engine/PhabricatorRepositoryDiscoveryEngine.php', @@ -3026,7 +3030,6 @@ phutil_register_library_map(array( 'PhabricatorSearchDocument' => 'applications/search/storage/document/PhabricatorSearchDocument.php', 'PhabricatorSearchDocumentField' => 'applications/search/storage/document/PhabricatorSearchDocumentField.php', 'PhabricatorSearchDocumentFieldType' => 'applications/search/constants/PhabricatorSearchDocumentFieldType.php', - 'PhabricatorSearchDocumentIndexer' => 'applications/search/index/PhabricatorSearchDocumentIndexer.php', 'PhabricatorSearchDocumentQuery' => 'applications/search/query/PhabricatorSearchDocumentQuery.php', 'PhabricatorSearchDocumentRelationship' => 'applications/search/storage/document/PhabricatorSearchDocumentRelationship.php', 'PhabricatorSearchDocumentTypeDatasource' => 'applications/search/typeahead/PhabricatorSearchDocumentTypeDatasource.php', @@ -3285,6 +3288,7 @@ phutil_register_library_map(array( 'PhabricatorUserEditorTestCase' => 'applications/people/editor/__tests__/PhabricatorUserEditorTestCase.php', 'PhabricatorUserEmail' => 'applications/people/storage/PhabricatorUserEmail.php', 'PhabricatorUserEmailTestCase' => 'applications/people/storage/__tests__/PhabricatorUserEmailTestCase.php', + 'PhabricatorUserFulltextEngine' => 'applications/people/search/PhabricatorUserFulltextEngine.php', 'PhabricatorUserLog' => 'applications/people/storage/PhabricatorUserLog.php', 'PhabricatorUserLogView' => 'applications/people/view/PhabricatorUserLogView.php', 'PhabricatorUserPHIDResolver' => 'applications/phid/resolver/PhabricatorUserPHIDResolver.php', @@ -3294,7 +3298,6 @@ phutil_register_library_map(array( 'PhabricatorUserRealNameField' => 'applications/people/customfield/PhabricatorUserRealNameField.php', 'PhabricatorUserRolesField' => 'applications/people/customfield/PhabricatorUserRolesField.php', 'PhabricatorUserSchemaSpec' => 'applications/people/storage/PhabricatorUserSchemaSpec.php', - 'PhabricatorUserSearchIndexer' => 'applications/people/search/PhabricatorUserSearchIndexer.php', 'PhabricatorUserSinceField' => 'applications/people/customfield/PhabricatorUserSinceField.php', 'PhabricatorUserStatusField' => 'applications/people/customfield/PhabricatorUserStatusField.php', 'PhabricatorUserTestCase' => 'applications/people/storage/__tests__/PhabricatorUserTestCase.php', @@ -3451,6 +3454,7 @@ phutil_register_library_map(array( 'PholioMockEditController' => 'applications/pholio/controller/PholioMockEditController.php', 'PholioMockEditor' => 'applications/pholio/editor/PholioMockEditor.php', 'PholioMockEmbedView' => 'applications/pholio/view/PholioMockEmbedView.php', + 'PholioMockFulltextEngine' => 'applications/pholio/search/PholioMockFulltextEngine.php', 'PholioMockHasTaskEdgeType' => 'applications/pholio/edge/PholioMockHasTaskEdgeType.php', 'PholioMockHeraldField' => 'applications/pholio/herald/PholioMockHeraldField.php', 'PholioMockHeraldFieldGroup' => 'applications/pholio/herald/PholioMockHeraldFieldGroup.php', @@ -3466,7 +3470,6 @@ phutil_register_library_map(array( 'PholioRemarkupRule' => 'applications/pholio/remarkup/PholioRemarkupRule.php', 'PholioReplyHandler' => 'applications/pholio/mail/PholioReplyHandler.php', 'PholioSchemaSpec' => 'applications/pholio/storage/PholioSchemaSpec.php', - 'PholioSearchIndexer' => 'applications/pholio/search/PholioSearchIndexer.php', 'PholioTransaction' => 'applications/pholio/storage/PholioTransaction.php', 'PholioTransactionComment' => 'applications/pholio/storage/PholioTransactionComment.php', 'PholioTransactionQuery' => 'applications/pholio/query/PholioTransactionQuery.php', @@ -3638,6 +3641,7 @@ phutil_register_library_map(array( 'PhrictionDocumentAuthorHeraldField' => 'applications/phriction/herald/PhrictionDocumentAuthorHeraldField.php', 'PhrictionDocumentContentHeraldField' => 'applications/phriction/herald/PhrictionDocumentContentHeraldField.php', 'PhrictionDocumentController' => 'applications/phriction/controller/PhrictionDocumentController.php', + 'PhrictionDocumentFulltextEngine' => 'applications/phriction/search/PhrictionDocumentFulltextEngine.php', 'PhrictionDocumentHeraldAdapter' => 'applications/phriction/herald/PhrictionDocumentHeraldAdapter.php', 'PhrictionDocumentHeraldField' => 'applications/phriction/herald/PhrictionDocumentHeraldField.php', 'PhrictionDocumentHeraldFieldGroup' => 'applications/phriction/herald/PhrictionDocumentHeraldFieldGroup.php', @@ -3658,7 +3662,6 @@ phutil_register_library_map(array( 'PhrictionReplyHandler' => 'applications/phriction/mail/PhrictionReplyHandler.php', 'PhrictionSchemaSpec' => 'applications/phriction/storage/PhrictionSchemaSpec.php', 'PhrictionSearchEngine' => 'applications/phriction/query/PhrictionSearchEngine.php', - 'PhrictionSearchIndexer' => 'applications/phriction/search/PhrictionSearchIndexer.php', 'PhrictionTransaction' => 'applications/phriction/storage/PhrictionTransaction.php', 'PhrictionTransactionComment' => 'applications/phriction/storage/PhrictionTransactionComment.php', 'PhrictionTransactionEditor' => 'applications/phriction/editor/PhrictionTransactionEditor.php', @@ -3693,6 +3696,7 @@ phutil_register_library_map(array( 'PonderQuestionCommentController' => 'applications/ponder/controller/PonderQuestionCommentController.php', 'PonderQuestionEditController' => 'applications/ponder/controller/PonderQuestionEditController.php', 'PonderQuestionEditor' => 'applications/ponder/editor/PonderQuestionEditor.php', + 'PonderQuestionFulltextEngine' => 'applications/ponder/search/PonderQuestionFulltextEngine.php', 'PonderQuestionHistoryController' => 'applications/ponder/controller/PonderQuestionHistoryController.php', 'PonderQuestionListController' => 'applications/ponder/controller/PonderQuestionListController.php', 'PonderQuestionMailReceiver' => 'applications/ponder/mail/PonderQuestionMailReceiver.php', @@ -3708,7 +3712,6 @@ phutil_register_library_map(array( 'PonderQuestionViewController' => 'applications/ponder/controller/PonderQuestionViewController.php', 'PonderRemarkupRule' => 'applications/ponder/remarkup/PonderRemarkupRule.php', 'PonderSchemaSpec' => 'applications/ponder/storage/PonderSchemaSpec.php', - 'PonderSearchIndexer' => 'applications/ponder/search/PonderSearchIndexer.php', 'PonderVotableInterface' => 'applications/ponder/storage/PonderVotableInterface.php', 'PonderVote' => 'applications/ponder/constants/PonderVote.php', 'PonderVoteEditor' => 'applications/ponder/editor/PonderVoteEditor.php', @@ -4398,6 +4401,7 @@ phutil_register_library_map(array( 'PhabricatorMentionableInterface', 'PhabricatorDestructibleInterface', 'PhabricatorProjectInterface', + 'PhabricatorFulltextInterface', ), 'DifferentialRevisionAffectedFilesHeraldField' => 'DifferentialRevisionHeraldField', 'DifferentialRevisionAuthorHeraldField' => 'DifferentialRevisionHeraldField', @@ -4411,6 +4415,7 @@ phutil_register_library_map(array( 'DifferentialRevisionDependsOnRevisionEdgeType' => 'PhabricatorEdgeType', 'DifferentialRevisionDetailView' => 'AphrontView', 'DifferentialRevisionEditController' => 'DifferentialController', + 'DifferentialRevisionFulltextEngine' => 'PhabricatorFulltextEngine', 'DifferentialRevisionHasCommitEdgeType' => 'PhabricatorEdgeType', 'DifferentialRevisionHasReviewerEdgeType' => 'PhabricatorEdgeType', 'DifferentialRevisionHasTaskEdgeType' => 'PhabricatorEdgeType', @@ -4436,7 +4441,6 @@ phutil_register_library_map(array( 'DifferentialRevisionUpdateHistoryView' => 'AphrontView', 'DifferentialRevisionViewController' => 'DifferentialController', 'DifferentialSchemaSpec' => 'PhabricatorConfigSchemaSpec', - 'DifferentialSearchIndexer' => 'PhabricatorSearchDocumentIndexer', 'DifferentialSetDiffPropertyConduitAPIMethod' => 'DifferentialConduitAPIMethod', 'DifferentialStoredCustomField' => 'DifferentialCustomField', 'DifferentialSubscribersField' => 'DifferentialCoreCustomField', @@ -4485,6 +4489,7 @@ phutil_register_library_map(array( 'DiffusionCommitDiffContentRemovedHeraldField' => 'DiffusionCommitHeraldField', 'DiffusionCommitDiffEnormousHeraldField' => 'DiffusionCommitHeraldField', 'DiffusionCommitEditController' => 'DiffusionController', + 'DiffusionCommitFulltextEngine' => 'PhabricatorFulltextEngine', 'DiffusionCommitHasRevisionEdgeType' => 'PhabricatorEdgeType', 'DiffusionCommitHasTaskEdgeType' => 'PhabricatorEdgeType', 'DiffusionCommitHash' => 'Phobject', @@ -4699,7 +4704,6 @@ phutil_register_library_map(array( 'DivinerAtomQuery' => 'PhabricatorCursorPagedPolicyAwareQuery', 'DivinerAtomRef' => 'Phobject', 'DivinerAtomSearchEngine' => 'PhabricatorApplicationSearchEngine', - 'DivinerAtomSearchIndexer' => 'PhabricatorSearchDocumentIndexer', 'DivinerAtomizeWorkflow' => 'DivinerWorkflow', 'DivinerAtomizer' => 'Phobject', 'DivinerBookController' => 'DivinerController', @@ -4708,7 +4712,6 @@ phutil_register_library_map(array( 'DivinerBookItemView' => 'AphrontTagView', 'DivinerBookPHIDType' => 'PhabricatorPHIDType', 'DivinerBookQuery' => 'PhabricatorCursorPagedPolicyAwareQuery', - 'DivinerBookSearchIndexer' => 'PhabricatorSearchDocumentIndexer', 'DivinerController' => 'PhabricatorController', 'DivinerDAO' => 'PhabricatorLiskDAO', 'DivinerDefaultEditCapability' => 'PhabricatorPolicyCapability', @@ -4725,8 +4728,10 @@ phutil_register_library_map(array( 'PhabricatorProjectInterface', 'PhabricatorDestructibleInterface', 'PhabricatorApplicationTransactionInterface', + 'PhabricatorFulltextInterface', ), 'DivinerLiveBookEditor' => 'PhabricatorApplicationTransactionEditor', + 'DivinerLiveBookFulltextEngine' => 'PhabricatorFulltextEngine', 'DivinerLiveBookTransaction' => 'PhabricatorApplicationTransaction', 'DivinerLiveBookTransactionQuery' => 'PhabricatorApplicationTransactionQuery', 'DivinerLivePublisher' => 'DivinerPublisher', @@ -4735,7 +4740,9 @@ phutil_register_library_map(array( 'PhabricatorPolicyInterface', 'PhabricatorMarkupInterface', 'PhabricatorDestructibleInterface', + 'PhabricatorFulltextInterface', ), + 'DivinerLiveSymbolFulltextEngine' => 'PhabricatorFulltextEngine', 'DivinerMainController' => 'DivinerController', 'DivinerPHPAtomizer' => 'DivinerAtomizer', 'DivinerParameterTableView' => 'AphrontTagView', @@ -4964,12 +4971,13 @@ phutil_register_library_map(array( 'PhabricatorFlaggableInterface', 'PhabricatorTokenReceiverInterface', 'PhabricatorDestructibleInterface', + 'PhabricatorFulltextInterface', ), 'FundInitiativeBackController' => 'FundController', 'FundInitiativeCloseController' => 'FundController', 'FundInitiativeEditController' => 'FundController', 'FundInitiativeEditor' => 'PhabricatorApplicationTransactionEditor', - 'FundInitiativeIndexer' => 'PhabricatorSearchDocumentIndexer', + 'FundInitiativeFulltextEngine' => 'PhabricatorFulltextEngine', 'FundInitiativeListController' => 'FundController', 'FundInitiativePHIDType' => 'PhabricatorPHIDType', 'FundInitiativeQuery' => 'PhabricatorCursorPagedPolicyAwareQuery', @@ -5351,7 +5359,6 @@ phutil_register_library_map(array( 'ManiphestReportController' => 'ManiphestController', 'ManiphestSchemaSpec' => 'PhabricatorConfigSchemaSpec', 'ManiphestSearchConduitAPIMethod' => 'PhabricatorSearchEngineAPIMethod', - 'ManiphestSearchIndexer' => 'PhabricatorSearchDocumentIndexer', 'ManiphestStatusConfigOptionType' => 'PhabricatorConfigJSONOptionType', 'ManiphestStatusEmailCommand' => 'ManiphestEmailCommand', 'ManiphestSubpriorityController' => 'ManiphestController', @@ -5370,6 +5377,7 @@ phutil_register_library_map(array( 'PhabricatorProjectInterface', 'PhabricatorSpacesInterface', 'PhabricatorConduitResultInterface', + 'PhabricatorFulltextInterface', ), 'ManiphestTaskAssignHeraldAction' => 'HeraldAction', 'ManiphestTaskAssignOtherHeraldAction' => 'ManiphestTaskAssignHeraldAction', @@ -5384,6 +5392,7 @@ phutil_register_library_map(array( 'ManiphestTaskDetailController' => 'ManiphestController', 'ManiphestTaskEditBulkJobType' => 'PhabricatorWorkerBulkJobType', 'ManiphestTaskEditController' => 'ManiphestController', + 'ManiphestTaskFulltextEngine' => 'PhabricatorFulltextEngine', 'ManiphestTaskHasCommitEdgeType' => 'PhabricatorEdgeType', 'ManiphestTaskHasMockEdgeType' => 'PhabricatorEdgeType', 'ManiphestTaskHasRevisionEdgeType' => 'PhabricatorEdgeType', @@ -5616,6 +5625,7 @@ phutil_register_library_map(array( 'PhabricatorSubscribableInterface', 'PhabricatorDestructibleInterface', 'PhabricatorSpacesInterface', + 'PhabricatorFulltextInterface', ), 'PassphraseCredentialAuthorPolicyRule' => 'PhabricatorPolicyRule', 'PassphraseCredentialConduitController' => 'PassphraseController', @@ -5623,6 +5633,7 @@ phutil_register_library_map(array( 'PassphraseCredentialCreateController' => 'PassphraseController', 'PassphraseCredentialDestroyController' => 'PassphraseController', 'PassphraseCredentialEditController' => 'PassphraseController', + 'PassphraseCredentialFulltextEngine' => 'PhabricatorFulltextEngine', 'PassphraseCredentialListController' => 'PassphraseController', 'PassphraseCredentialLockController' => 'PassphraseController', 'PassphraseCredentialPHIDType' => 'PhabricatorPHIDType', @@ -5650,7 +5661,6 @@ phutil_register_library_map(array( 'PassphraseSSHPrivateKeyFileCredentialType' => 'PassphraseSSHPrivateKeyCredentialType', 'PassphraseSSHPrivateKeyTextCredentialType' => 'PassphraseSSHPrivateKeyCredentialType', 'PassphraseSchemaSpec' => 'PhabricatorConfigSchemaSpec', - 'PassphraseSearchIndexer' => 'PhabricatorSearchDocumentIndexer', 'PassphraseSecret' => 'PassphraseDAO', 'PasteConduitAPIMethod' => 'ConduitAPIMethod', 'PasteCreateConduitAPIMethod' => 'PasteConduitAPIMethod', @@ -5971,6 +5981,7 @@ phutil_register_library_map(array( 'PhabricatorMentionableInterface', 'PhabricatorFlaggableInterface', 'PhabricatorSpacesInterface', + 'PhabricatorFulltextInterface', ), 'PhabricatorCalendarEventCancelController' => 'PhabricatorCalendarController', 'PhabricatorCalendarEventCommentController' => 'PhabricatorCalendarController', @@ -5978,6 +5989,7 @@ phutil_register_library_map(array( 'PhabricatorCalendarEventEditController' => 'PhabricatorCalendarController', 'PhabricatorCalendarEventEditor' => 'PhabricatorApplicationTransactionEditor', 'PhabricatorCalendarEventEmailCommand' => 'MetaMTAEmailTransactionCommand', + 'PhabricatorCalendarEventFulltextEngine' => 'PhabricatorFulltextEngine', 'PhabricatorCalendarEventInvitee' => array( 'PhabricatorCalendarDAO', 'PhabricatorPolicyInterface', @@ -5990,7 +6002,6 @@ phutil_register_library_map(array( 'PhabricatorCalendarEventQuery' => 'PhabricatorCursorPagedPolicyAwareQuery', 'PhabricatorCalendarEventRSVPEmailCommand' => 'PhabricatorCalendarEventEmailCommand', 'PhabricatorCalendarEventSearchEngine' => 'PhabricatorApplicationSearchEngine', - 'PhabricatorCalendarEventSearchIndexer' => 'PhabricatorSearchDocumentIndexer', 'PhabricatorCalendarEventTransaction' => 'PhabricatorApplicationTransaction', 'PhabricatorCalendarEventTransactionComment' => 'PhabricatorApplicationTransactionComment', 'PhabricatorCalendarEventTransactionQuery' => 'PhabricatorApplicationTransactionQuery', @@ -6552,8 +6563,10 @@ phutil_register_library_map(array( 'PhabricatorFlaggableInterface' => 'PhabricatorPHIDInterface', 'PhabricatorFlagsApplication' => 'PhabricatorApplication', 'PhabricatorFlagsUIEventListener' => 'PhabricatorEventListener', + 'PhabricatorFulltextEngine' => 'Phobject', 'PhabricatorFulltextEngineExtension' => 'Phobject', 'PhabricatorFulltextEngineExtensionModule' => 'PhabricatorConfigModule', + 'PhabricatorFulltextIndexEngineExtension' => 'PhabricatorIndexEngineExtension', 'PhabricatorFundApplication' => 'PhabricatorApplication', 'PhabricatorGDSetupCheck' => 'PhabricatorSetupCheck', 'PhabricatorGarbageCollector' => 'Phobject', @@ -6637,6 +6650,7 @@ phutil_register_library_map(array( 'PhabricatorLipsumManagementWorkflow' => 'PhabricatorManagementWorkflow', 'PhabricatorLipsumMondrianArtist' => 'PhabricatorLipsumArtist', 'PhabricatorLiskDAO' => 'LiskDAO', + 'PhabricatorLiskFulltextEngineExtension' => 'PhabricatorFulltextEngineExtension', 'PhabricatorLiskSearchEngineExtension' => 'PhabricatorSearchEngineExtension', 'PhabricatorLiskSerializer' => 'Phobject', 'PhabricatorListFilterUIExample' => 'PhabricatorUIExample', @@ -7100,6 +7114,7 @@ phutil_register_library_map(array( 'PhabricatorSubscribableInterface', 'PhabricatorCustomFieldInterface', 'PhabricatorDestructibleInterface', + 'PhabricatorFulltextInterface', ), 'PhabricatorProjectAddHeraldAction' => 'PhabricatorProjectHeraldAction', 'PhabricatorProjectApplication' => 'PhabricatorApplication', @@ -7144,6 +7159,7 @@ phutil_register_library_map(array( 'PhabricatorProjectEditPictureController' => 'PhabricatorProjectController', 'PhabricatorProjectEditorTestCase' => 'PhabricatorTestCase', 'PhabricatorProjectFeedController' => 'PhabricatorProjectController', + 'PhabricatorProjectFulltextEngine' => 'PhabricatorFulltextEngine', 'PhabricatorProjectHeraldAction' => 'HeraldAction', 'PhabricatorProjectIconSet' => 'PhabricatorIconSet', 'PhabricatorProjectListController' => 'PhabricatorProjectController', @@ -7171,7 +7187,6 @@ phutil_register_library_map(array( 'PhabricatorProjectSchemaSpec' => 'PhabricatorConfigSchemaSpec', 'PhabricatorProjectSearchEngine' => 'PhabricatorApplicationSearchEngine', 'PhabricatorProjectSearchField' => 'PhabricatorSearchTokenizerField', - 'PhabricatorProjectSearchIndexer' => 'PhabricatorSearchDocumentIndexer', 'PhabricatorProjectSlug' => 'PhabricatorProjectDAO', 'PhabricatorProjectStandardCustomField' => array( 'PhabricatorProjectCustomField', @@ -7245,6 +7260,7 @@ phutil_register_library_map(array( 'HarbormasterBuildableInterface', 'PhabricatorCustomFieldInterface', 'PhabricatorApplicationTransactionInterface', + 'PhabricatorFulltextInterface', ), 'PhabricatorRepositoryCommitChangeParserWorker' => 'PhabricatorRepositoryCommitParserWorker', 'PhabricatorRepositoryCommitData' => 'PhabricatorRepositoryDAO', @@ -7254,7 +7270,6 @@ phutil_register_library_map(array( 'PhabricatorRepositoryCommitPHIDType' => 'PhabricatorPHIDType', 'PhabricatorRepositoryCommitParserWorker' => 'PhabricatorWorker', 'PhabricatorRepositoryCommitRef' => 'Phobject', - 'PhabricatorRepositoryCommitSearchIndexer' => 'PhabricatorSearchDocumentIndexer', 'PhabricatorRepositoryConfigOptions' => 'PhabricatorApplicationConfigOptions', 'PhabricatorRepositoryDAO' => 'PhabricatorLiskDAO', 'PhabricatorRepositoryDiscoveryEngine' => 'PhabricatorRepositoryEngine', @@ -7380,7 +7395,6 @@ phutil_register_library_map(array( 'PhabricatorSearchDocument' => 'PhabricatorSearchDAO', 'PhabricatorSearchDocumentField' => 'PhabricatorSearchDAO', 'PhabricatorSearchDocumentFieldType' => 'Phobject', - 'PhabricatorSearchDocumentIndexer' => 'Phobject', 'PhabricatorSearchDocumentQuery' => 'PhabricatorCursorPagedPolicyAwareQuery', 'PhabricatorSearchDocumentRelationship' => 'PhabricatorSearchDAO', 'PhabricatorSearchDocumentTypeDatasource' => 'PhabricatorTypeaheadDatasource', @@ -7656,6 +7670,7 @@ phutil_register_library_map(array( 'PhabricatorSSHPublicKeyInterface', 'PhabricatorFlaggableInterface', 'PhabricatorApplicationTransactionInterface', + 'PhabricatorFulltextInterface', ), 'PhabricatorUserBlurbField' => 'PhabricatorUserCustomField', 'PhabricatorUserConfigOptions' => 'PhabricatorApplicationConfigOptions', @@ -7672,6 +7687,7 @@ phutil_register_library_map(array( 'PhabricatorUserEditorTestCase' => 'PhabricatorTestCase', 'PhabricatorUserEmail' => 'PhabricatorUserDAO', 'PhabricatorUserEmailTestCase' => 'PhabricatorTestCase', + 'PhabricatorUserFulltextEngine' => 'PhabricatorFulltextEngine', 'PhabricatorUserLog' => array( 'PhabricatorUserDAO', 'PhabricatorPolicyInterface', @@ -7684,7 +7700,6 @@ phutil_register_library_map(array( 'PhabricatorUserRealNameField' => 'PhabricatorUserCustomField', 'PhabricatorUserRolesField' => 'PhabricatorUserCustomField', 'PhabricatorUserSchemaSpec' => 'PhabricatorConfigSchemaSpec', - 'PhabricatorUserSearchIndexer' => 'PhabricatorSearchDocumentIndexer', 'PhabricatorUserSinceField' => 'PhabricatorUserCustomField', 'PhabricatorUserStatusField' => 'PhabricatorUserCustomField', 'PhabricatorUserTestCase' => 'PhabricatorTestCase', @@ -7883,6 +7898,7 @@ phutil_register_library_map(array( 'PhabricatorDestructibleInterface', 'PhabricatorSpacesInterface', 'PhabricatorMentionableInterface', + 'PhabricatorFulltextInterface', ), 'PholioMockArchiveController' => 'PholioController', 'PholioMockAuthorHeraldField' => 'PholioMockHeraldField', @@ -7891,6 +7907,7 @@ phutil_register_library_map(array( 'PholioMockEditController' => 'PholioController', 'PholioMockEditor' => 'PhabricatorApplicationTransactionEditor', 'PholioMockEmbedView' => 'AphrontView', + 'PholioMockFulltextEngine' => 'PhabricatorFulltextEngine', 'PholioMockHasTaskEdgeType' => 'PhabricatorEdgeType', 'PholioMockHeraldField' => 'HeraldField', 'PholioMockHeraldFieldGroup' => 'HeraldFieldGroup', @@ -7906,7 +7923,6 @@ phutil_register_library_map(array( 'PholioRemarkupRule' => 'PhabricatorObjectRemarkupRule', 'PholioReplyHandler' => 'PhabricatorApplicationTransactionReplyHandler', 'PholioSchemaSpec' => 'PhabricatorConfigSchemaSpec', - 'PholioSearchIndexer' => 'PhabricatorSearchDocumentIndexer', 'PholioTransaction' => 'PhabricatorApplicationTransaction', 'PholioTransactionComment' => 'PhabricatorApplicationTransactionComment', 'PholioTransactionQuery' => 'PhabricatorApplicationTransactionQuery', @@ -8129,10 +8145,12 @@ phutil_register_library_map(array( 'PhabricatorTokenReceiverInterface', 'PhabricatorDestructibleInterface', 'PhabricatorApplicationTransactionInterface', + 'PhabricatorFulltextInterface', ), 'PhrictionDocumentAuthorHeraldField' => 'PhrictionDocumentHeraldField', 'PhrictionDocumentContentHeraldField' => 'PhrictionDocumentHeraldField', 'PhrictionDocumentController' => 'PhrictionController', + 'PhrictionDocumentFulltextEngine' => 'PhabricatorFulltextEngine', 'PhrictionDocumentHeraldAdapter' => 'HeraldAdapter', 'PhrictionDocumentHeraldField' => 'HeraldField', 'PhrictionDocumentHeraldFieldGroup' => 'HeraldFieldGroup', @@ -8153,7 +8171,6 @@ phutil_register_library_map(array( 'PhrictionReplyHandler' => 'PhabricatorApplicationTransactionReplyHandler', 'PhrictionSchemaSpec' => 'PhabricatorConfigSchemaSpec', 'PhrictionSearchEngine' => 'PhabricatorApplicationSearchEngine', - 'PhrictionSearchIndexer' => 'PhabricatorSearchDocumentIndexer', 'PhrictionTransaction' => 'PhabricatorApplicationTransaction', 'PhrictionTransactionComment' => 'PhabricatorApplicationTransactionComment', 'PhrictionTransactionEditor' => 'PhabricatorApplicationTransactionEditor', @@ -8204,10 +8221,12 @@ phutil_register_library_map(array( 'PhabricatorProjectInterface', 'PhabricatorDestructibleInterface', 'PhabricatorSpacesInterface', + 'PhabricatorFulltextInterface', ), 'PonderQuestionCommentController' => 'PonderController', 'PonderQuestionEditController' => 'PonderController', 'PonderQuestionEditor' => 'PonderEditor', + 'PonderQuestionFulltextEngine' => 'PhabricatorFulltextEngine', 'PonderQuestionHistoryController' => 'PonderController', 'PonderQuestionListController' => 'PonderController', 'PonderQuestionMailReceiver' => 'PhabricatorObjectMailReceiver', @@ -8223,7 +8242,6 @@ phutil_register_library_map(array( 'PonderQuestionViewController' => 'PonderController', 'PonderRemarkupRule' => 'PhabricatorObjectRemarkupRule', 'PonderSchemaSpec' => 'PhabricatorConfigSchemaSpec', - 'PonderSearchIndexer' => 'PhabricatorSearchDocumentIndexer', 'PonderVote' => 'PonderConstants', 'PonderVoteEditor' => 'PhabricatorEditor', 'PonderVotingUserHasAnswerEdgeType' => 'PhabricatorEdgeType', diff --git a/src/applications/calendar/search/PhabricatorCalendarEventFulltextEngine.php b/src/applications/calendar/search/PhabricatorCalendarEventFulltextEngine.php new file mode 100644 index 0000000000..8447a6a30d --- /dev/null +++ b/src/applications/calendar/search/PhabricatorCalendarEventFulltextEngine.php @@ -0,0 +1,39 @@ +setDocumentTitle($event->getName()); + + $document->addField( + PhabricatorSearchDocumentFieldType::FIELD_BODY, + $event->getDescription()); + + $document->addRelationship( + PhabricatorSearchRelationship::RELATIONSHIP_AUTHOR, + $event->getUserPHID(), + PhabricatorPeopleUserPHIDType::TYPECONST, + $event->getDateCreated()); + + $document->addRelationship( + PhabricatorSearchRelationship::RELATIONSHIP_OWNER, + $event->getUserPHID(), + PhabricatorPeopleUserPHIDType::TYPECONST, + $event->getDateCreated()); + + $document->addRelationship( + $event->getIsCancelled() + ? PhabricatorSearchRelationship::RELATIONSHIP_CLOSED + : PhabricatorSearchRelationship::RELATIONSHIP_OPEN, + $event->getPHID(), + PhabricatorCalendarEventPHIDType::TYPECONST, + PhabricatorTime::getNow()); + } + +} diff --git a/src/applications/calendar/search/PhabricatorCalendarEventSearchIndexer.php b/src/applications/calendar/search/PhabricatorCalendarEventSearchIndexer.php deleted file mode 100644 index 80982cacf4..0000000000 --- a/src/applications/calendar/search/PhabricatorCalendarEventSearchIndexer.php +++ /dev/null @@ -1,47 +0,0 @@ -loadDocumentByPHID($phid); - - $doc = new PhabricatorSearchAbstractDocument(); - $doc->setPHID($event->getPHID()); - $doc->setDocumentType(PhabricatorCalendarEventPHIDType::TYPECONST); - $doc->setDocumentTitle($event->getName()); - $doc->setDocumentCreated($event->getDateCreated()); - $doc->setDocumentModified($event->getDateModified()); - - $doc->addField( - PhabricatorSearchDocumentFieldType::FIELD_BODY, - $event->getDescription()); - - $doc->addRelationship( - PhabricatorSearchRelationship::RELATIONSHIP_AUTHOR, - $event->getUserPHID(), - PhabricatorPeopleUserPHIDType::TYPECONST, - $event->getDateCreated()); - - $doc->addRelationship( - PhabricatorSearchRelationship::RELATIONSHIP_OWNER, - $event->getUserPHID(), - PhabricatorPeopleUserPHIDType::TYPECONST, - $event->getDateCreated()); - - $doc->addRelationship( - $event->getIsCancelled() - ? PhabricatorSearchRelationship::RELATIONSHIP_CLOSED - : PhabricatorSearchRelationship::RELATIONSHIP_OPEN, - $event->getPHID(), - PhabricatorCalendarEventPHIDType::TYPECONST, - time()); - - return $doc; - } - -} diff --git a/src/applications/calendar/storage/PhabricatorCalendarEvent.php b/src/applications/calendar/storage/PhabricatorCalendarEvent.php index 6f0ff98b3c..1b4c1a760c 100644 --- a/src/applications/calendar/storage/PhabricatorCalendarEvent.php +++ b/src/applications/calendar/storage/PhabricatorCalendarEvent.php @@ -10,7 +10,8 @@ final class PhabricatorCalendarEvent extends PhabricatorCalendarDAO PhabricatorDestructibleInterface, PhabricatorMentionableInterface, PhabricatorFlaggableInterface, - PhabricatorSpacesInterface { + PhabricatorSpacesInterface, + PhabricatorFulltextInterface { protected $name; protected $userPHID; @@ -562,4 +563,13 @@ final class PhabricatorCalendarEvent extends PhabricatorCalendarDAO public function getSpacePHID() { return $this->spacePHID; } + + +/* -( PhabricatorFulltextInterface )--------------------------------------- */ + + + public function newFulltextEngine() { + return new PhabricatorCalendarEventFulltextEngine(); + } + } diff --git a/src/applications/differential/search/DifferentialRevisionFulltextEngine.php b/src/applications/differential/search/DifferentialRevisionFulltextEngine.php new file mode 100644 index 0000000000..60d267fe71 --- /dev/null +++ b/src/applications/differential/search/DifferentialRevisionFulltextEngine.php @@ -0,0 +1,64 @@ +setViewer($this->getViewer()) + ->withPHIDs(array($object->getPHID())) + ->needReviewerStatus(true) + ->executeOne(); + + // TODO: This isn't very clean, but custom fields currently rely on it. + $object->attachReviewerStatus($revision->getReviewerStatus()); + + $document->setDocumentTitle($revision->getTitle()); + + $document->addRelationship( + PhabricatorSearchRelationship::RELATIONSHIP_AUTHOR, + $revision->getAuthorPHID(), + PhabricatorPeopleUserPHIDType::TYPECONST, + $revision->getDateCreated()); + + $document->addRelationship( + $revision->isClosed() + ? PhabricatorSearchRelationship::RELATIONSHIP_CLOSED + : PhabricatorSearchRelationship::RELATIONSHIP_OPEN, + $revision->getPHID(), + DifferentialRevisionPHIDType::TYPECONST, + PhabricatorTime::getNow()); + + // If a revision needs review, the owners are the reviewers. Otherwise, the + // owner is the author (e.g., accepted, rejected, closed). + $status_review = ArcanistDifferentialRevisionStatus::NEEDS_REVIEW; + if ($revision->getStatus() == $status_review) { + $reviewers = $revision->getReviewerStatus(); + $reviewers = mpull($reviewers, 'getReviewerPHID', 'getReviewerPHID'); + if ($reviewers) { + foreach ($reviewers as $phid) { + $document->addRelationship( + PhabricatorSearchRelationship::RELATIONSHIP_OWNER, + $phid, + PhabricatorPeopleUserPHIDType::TYPECONST, + $revision->getDateModified()); // Bogus timestamp. + } + } else { + $document->addRelationship( + PhabricatorSearchRelationship::RELATIONSHIP_UNOWNED, + $revision->getPHID(), + PhabricatorPeopleUserPHIDType::TYPECONST, + $revision->getDateModified()); // Bogus timestamp. + } + } else { + $document->addRelationship( + PhabricatorSearchRelationship::RELATIONSHIP_OWNER, + $revision->getAuthorPHID(), + PhabricatorPHIDConstants::PHID_TYPE_VOID, + $revision->getDateCreated()); + } + } +} diff --git a/src/applications/differential/search/DifferentialSearchIndexer.php b/src/applications/differential/search/DifferentialSearchIndexer.php deleted file mode 100644 index f5c340521f..0000000000 --- a/src/applications/differential/search/DifferentialSearchIndexer.php +++ /dev/null @@ -1,76 +0,0 @@ -setViewer($this->getViewer()) - ->withPHIDs(array($phid)) - ->needReviewerStatus(true) - ->executeOne(); - if (!$object) { - throw new Exception(pht("Unable to load object by PHID '%s'!", $phid)); - } - return $object; - } - - protected function buildAbstractDocumentByPHID($phid) { - $rev = $this->loadDocumentByPHID($phid); - - $doc = new PhabricatorSearchAbstractDocument(); - $doc->setPHID($rev->getPHID()); - $doc->setDocumentType(DifferentialRevisionPHIDType::TYPECONST); - $doc->setDocumentTitle($rev->getTitle()); - $doc->setDocumentCreated($rev->getDateCreated()); - $doc->setDocumentModified($rev->getDateModified()); - - $doc->addRelationship( - PhabricatorSearchRelationship::RELATIONSHIP_AUTHOR, - $rev->getAuthorPHID(), - PhabricatorPeopleUserPHIDType::TYPECONST, - $rev->getDateCreated()); - - $doc->addRelationship( - $rev->isClosed() - ? PhabricatorSearchRelationship::RELATIONSHIP_CLOSED - : PhabricatorSearchRelationship::RELATIONSHIP_OPEN, - $rev->getPHID(), - DifferentialRevisionPHIDType::TYPECONST, - time()); - - // If a revision needs review, the owners are the reviewers. Otherwise, the - // owner is the author (e.g., accepted, rejected, closed). - if ($rev->getStatus() == ArcanistDifferentialRevisionStatus::NEEDS_REVIEW) { - $reviewers = $rev->getReviewerStatus(); - $reviewers = mpull($reviewers, 'getReviewerPHID', 'getReviewerPHID'); - if ($reviewers) { - foreach ($reviewers as $phid) { - $doc->addRelationship( - PhabricatorSearchRelationship::RELATIONSHIP_OWNER, - $phid, - PhabricatorPeopleUserPHIDType::TYPECONST, - $rev->getDateModified()); // Bogus timestamp. - } - } else { - $doc->addRelationship( - PhabricatorSearchRelationship::RELATIONSHIP_UNOWNED, - $rev->getPHID(), - PhabricatorPeopleUserPHIDType::TYPECONST, - $rev->getDateModified()); // Bogus timestamp. - } - } else { - $doc->addRelationship( - PhabricatorSearchRelationship::RELATIONSHIP_OWNER, - $rev->getAuthorPHID(), - PhabricatorPHIDConstants::PHID_TYPE_VOID, - $rev->getDateCreated()); - } - - return $doc; - } -} diff --git a/src/applications/differential/storage/DifferentialRevision.php b/src/applications/differential/storage/DifferentialRevision.php index 84b77f0c48..e534ad9ca7 100644 --- a/src/applications/differential/storage/DifferentialRevision.php +++ b/src/applications/differential/storage/DifferentialRevision.php @@ -13,7 +13,8 @@ final class DifferentialRevision extends DifferentialDAO PhabricatorApplicationTransactionInterface, PhabricatorMentionableInterface, PhabricatorDestructibleInterface, - PhabricatorProjectInterface { + PhabricatorProjectInterface, + PhabricatorFulltextInterface { protected $title = ''; protected $originalTitle; @@ -629,4 +630,13 @@ final class DifferentialRevision extends DifferentialDAO $this->saveTransaction(); } + +/* -( PhabricatorFulltextInterface )--------------------------------------- */ + + + public function newFulltextEngine() { + return new DifferentialRevisionFulltextEngine(); + } + + } diff --git a/src/applications/diviner/search/DivinerBookSearchIndexer.php b/src/applications/diviner/search/DivinerBookSearchIndexer.php deleted file mode 100644 index 6cb9301b76..0000000000 --- a/src/applications/diviner/search/DivinerBookSearchIndexer.php +++ /dev/null @@ -1,31 +0,0 @@ -loadDocumentByPHID($phid); - - $doc = $this->newDocument($phid) - ->setDocumentTitle($book->getTitle()) - ->setDocumentCreated($book->getDateCreated()) - ->setDocumentModified($book->getDateModified()); - - $doc->addField( - PhabricatorSearchDocumentFieldType::FIELD_BODY, - $book->getPreface()); - - $doc->addRelationship( - PhabricatorSearchRelationship::RELATIONSHIP_REPOSITORY, - $book->getRepositoryPHID(), - PhabricatorRepositoryRepositoryPHIDType::TYPECONST, - $book->getDateCreated()); - - return $doc; - } - - -} diff --git a/src/applications/diviner/search/DivinerLiveBookFulltextEngine.php b/src/applications/diviner/search/DivinerLiveBookFulltextEngine.php new file mode 100644 index 0000000000..35ff454d53 --- /dev/null +++ b/src/applications/diviner/search/DivinerLiveBookFulltextEngine.php @@ -0,0 +1,26 @@ +setDocumentTitle($book->getTitle()); + + $document->addField( + PhabricatorSearchDocumentFieldType::FIELD_BODY, + $book->getPreface()); + + $document->addRelationship( + PhabricatorSearchRelationship::RELATIONSHIP_REPOSITORY, + $book->getRepositoryPHID(), + PhabricatorRepositoryRepositoryPHIDType::TYPECONST, + $book->getDateCreated()); + } + + +} diff --git a/src/applications/diviner/search/DivinerAtomSearchIndexer.php b/src/applications/diviner/search/DivinerLiveSymbolFulltextEngine.php similarity index 64% rename from src/applications/diviner/search/DivinerAtomSearchIndexer.php rename to src/applications/diviner/search/DivinerLiveSymbolFulltextEngine.php index 0719f807f6..694af0a27b 100644 --- a/src/applications/diviner/search/DivinerAtomSearchIndexer.php +++ b/src/applications/diviner/search/DivinerLiveSymbolFulltextEngine.php @@ -1,49 +1,43 @@ loadDocumentByPHID($phid); + $atom = $object; $book = $atom->getBook(); - if (!$atom->getIsDocumentable()) { - return null; - } - - $doc = $this->newDocument($phid) + $document ->setDocumentTitle($atom->getTitle()) ->setDocumentCreated($book->getDateCreated()) ->setDocumentModified($book->getDateModified()); - $doc->addField( + $document->addField( PhabricatorSearchDocumentFieldType::FIELD_BODY, $atom->getSummary()); - $doc->addRelationship( + $document->addRelationship( PhabricatorSearchRelationship::RELATIONSHIP_BOOK, $atom->getBookPHID(), DivinerBookPHIDType::TYPECONST, PhabricatorTime::getNow()); - $doc->addRelationship( + $document->addRelationship( PhabricatorSearchRelationship::RELATIONSHIP_REPOSITORY, $atom->getRepositoryPHID(), PhabricatorRepositoryRepositoryPHIDType::TYPECONST, PhabricatorTime::getNow()); - $doc->addRelationship( + $document->addRelationship( $atom->getGraphHash() ? PhabricatorSearchRelationship::RELATIONSHIP_CLOSED : PhabricatorSearchRelationship::RELATIONSHIP_OPEN, $atom->getBookPHID(), DivinerBookPHIDType::TYPECONST, PhabricatorTime::getNow()); - - return $doc; } } diff --git a/src/applications/diviner/storage/DivinerLiveBook.php b/src/applications/diviner/storage/DivinerLiveBook.php index 872dcb6eeb..079c5a9f4c 100644 --- a/src/applications/diviner/storage/DivinerLiveBook.php +++ b/src/applications/diviner/storage/DivinerLiveBook.php @@ -5,7 +5,8 @@ final class DivinerLiveBook extends DivinerDAO PhabricatorPolicyInterface, PhabricatorProjectInterface, PhabricatorDestructibleInterface, - PhabricatorApplicationTransactionInterface { + PhabricatorApplicationTransactionInterface, + PhabricatorFulltextInterface { protected $name; protected $repositoryPHID; @@ -161,4 +162,12 @@ final class DivinerLiveBook extends DivinerDAO return $timeline; } +/* -( PhabricatorFulltextInterface )--------------------------------------- */ + + + public function newFulltextEngine() { + return new DivinerLiveBookFulltextEngine(); + } + + } diff --git a/src/applications/diviner/storage/DivinerLiveSymbol.php b/src/applications/diviner/storage/DivinerLiveSymbol.php index 75ea3bcd7b..38b99208a7 100644 --- a/src/applications/diviner/storage/DivinerLiveSymbol.php +++ b/src/applications/diviner/storage/DivinerLiveSymbol.php @@ -4,7 +4,8 @@ final class DivinerLiveSymbol extends DivinerDAO implements PhabricatorPolicyInterface, PhabricatorMarkupInterface, - PhabricatorDestructibleInterface { + PhabricatorDestructibleInterface, + PhabricatorFulltextInterface { protected $bookPHID; protected $repositoryPHID; @@ -280,4 +281,16 @@ final class DivinerLiveSymbol extends DivinerDAO $this->saveTransaction(); } + +/* -( PhabricatorFulltextInterface )--------------------------------------- */ + + + public function newFulltextEngine() { + if (!$this->getIsDocumentable()) { + return null; + } + + return new DivinerLiveSymbolFulltextEngine(); + } + } diff --git a/src/applications/fund/search/FundInitiativeFulltextEngine.php b/src/applications/fund/search/FundInitiativeFulltextEngine.php new file mode 100644 index 0000000000..177d76bd4d --- /dev/null +++ b/src/applications/fund/search/FundInitiativeFulltextEngine.php @@ -0,0 +1,34 @@ +setDocumentTitle($initiative->getName()); + + $document->addRelationship( + PhabricatorSearchRelationship::RELATIONSHIP_AUTHOR, + $initiative->getOwnerPHID(), + PhabricatorPeopleUserPHIDType::TYPECONST, + $initiative->getDateCreated()); + + $document->addRelationship( + PhabricatorSearchRelationship::RELATIONSHIP_OWNER, + $initiative->getOwnerPHID(), + PhabricatorPeopleUserPHIDType::TYPECONST, + $initiative->getDateCreated()); + + $document->addRelationship( + $initiative->isClosed() + ? PhabricatorSearchRelationship::RELATIONSHIP_CLOSED + : PhabricatorSearchRelationship::RELATIONSHIP_OPEN, + $initiative->getPHID(), + FundInitiativePHIDType::TYPECONST, + PhabricatorTime::getNow()); + } +} diff --git a/src/applications/fund/search/FundInitiativeIndexer.php b/src/applications/fund/search/FundInitiativeIndexer.php deleted file mode 100644 index 3c8afed636..0000000000 --- a/src/applications/fund/search/FundInitiativeIndexer.php +++ /dev/null @@ -1,56 +0,0 @@ -setViewer($this->getViewer()) - ->withPHIDs(array($phid)) - ->executeOne(); - if (!$object) { - throw new Exception( - pht( - "Unable to load object by PHID '%s'!", - $phid)); - } - return $object; - } - - protected function buildAbstractDocumentByPHID($phid) { - $initiative = $this->loadDocumentByPHID($phid); - - $doc = id(new PhabricatorSearchAbstractDocument()) - ->setPHID($initiative->getPHID()) - ->setDocumentType(FundInitiativePHIDType::TYPECONST) - ->setDocumentTitle($initiative->getName()) - ->setDocumentCreated($initiative->getDateCreated()) - ->setDocumentModified($initiative->getDateModified()); - - $doc->addRelationship( - PhabricatorSearchRelationship::RELATIONSHIP_AUTHOR, - $initiative->getOwnerPHID(), - PhabricatorPeopleUserPHIDType::TYPECONST, - $initiative->getDateCreated()); - - $doc->addRelationship( - PhabricatorSearchRelationship::RELATIONSHIP_OWNER, - $initiative->getOwnerPHID(), - PhabricatorPeopleUserPHIDType::TYPECONST, - $initiative->getDateCreated()); - - $doc->addRelationship( - $initiative->isClosed() - ? PhabricatorSearchRelationship::RELATIONSHIP_CLOSED - : PhabricatorSearchRelationship::RELATIONSHIP_OPEN, - $initiative->getPHID(), - FundInitiativePHIDType::TYPECONST, - time()); - - return $doc; - } -} diff --git a/src/applications/fund/storage/FundInitiative.php b/src/applications/fund/storage/FundInitiative.php index 6acc19f5fc..57e86beccf 100644 --- a/src/applications/fund/storage/FundInitiative.php +++ b/src/applications/fund/storage/FundInitiative.php @@ -9,7 +9,8 @@ final class FundInitiative extends FundDAO PhabricatorMentionableInterface, PhabricatorFlaggableInterface, PhabricatorTokenReceiverInterface, - PhabricatorDestructibleInterface { + PhabricatorDestructibleInterface, + PhabricatorFulltextInterface { protected $name; protected $ownerPHID; @@ -207,4 +208,12 @@ final class FundInitiative extends FundDAO $this->saveTransaction(); } + +/* -( PhabricatorFulltextInterface )--------------------------------------- */ + + + public function newFulltextEngine() { + return new FundInitiativeFulltextEngine(); + } + } diff --git a/src/applications/maniphest/search/ManiphestSearchIndexer.php b/src/applications/maniphest/search/ManiphestTaskFulltextEngine.php similarity index 54% rename from src/applications/maniphest/search/ManiphestSearchIndexer.php rename to src/applications/maniphest/search/ManiphestTaskFulltextEngine.php index e6f30666c0..7d73c53e87 100644 --- a/src/applications/maniphest/search/ManiphestSearchIndexer.php +++ b/src/applications/maniphest/search/ManiphestTaskFulltextEngine.php @@ -1,55 +1,48 @@ loadDocumentByPHID($phid); + $task = $object; - $doc = new PhabricatorSearchAbstractDocument(); - $doc->setPHID($task->getPHID()); - $doc->setDocumentType(ManiphestTaskPHIDType::TYPECONST); - $doc->setDocumentTitle($task->getTitle()); - $doc->setDocumentCreated($task->getDateCreated()); - $doc->setDocumentModified($task->getDateModified()); + $document->setDocumentTitle($task->getTitle()); - $doc->addField( + $document->addField( PhabricatorSearchDocumentFieldType::FIELD_BODY, $task->getDescription()); - $doc->addRelationship( + $document->addRelationship( PhabricatorSearchRelationship::RELATIONSHIP_AUTHOR, $task->getAuthorPHID(), PhabricatorPeopleUserPHIDType::TYPECONST, $task->getDateCreated()); - $doc->addRelationship( + $document->addRelationship( $task->isClosed() ? PhabricatorSearchRelationship::RELATIONSHIP_CLOSED : PhabricatorSearchRelationship::RELATIONSHIP_OPEN, $task->getPHID(), ManiphestTaskPHIDType::TYPECONST, - time()); + PhabricatorTime::getNow()); $owner = $task->getOwnerPHID(); if ($owner) { - $doc->addRelationship( + $document->addRelationship( PhabricatorSearchRelationship::RELATIONSHIP_OWNER, $owner, PhabricatorPeopleUserPHIDType::TYPECONST, time()); } else { - $doc->addRelationship( + $document->addRelationship( PhabricatorSearchRelationship::RELATIONSHIP_UNOWNED, $task->getPHID(), PhabricatorPHIDConstants::PHID_TYPE_VOID, $task->getDateCreated()); } - - return $doc; } } diff --git a/src/applications/maniphest/storage/ManiphestTask.php b/src/applications/maniphest/storage/ManiphestTask.php index c4fe177268..9f8dad1cd8 100644 --- a/src/applications/maniphest/storage/ManiphestTask.php +++ b/src/applications/maniphest/storage/ManiphestTask.php @@ -14,7 +14,8 @@ final class ManiphestTask extends ManiphestDAO PhabricatorApplicationTransactionInterface, PhabricatorProjectInterface, PhabricatorSpacesInterface, - PhabricatorConduitResultInterface { + PhabricatorConduitResultInterface, + PhabricatorFulltextInterface { const MARKUP_FIELD_DESCRIPTION = 'markup:desc'; @@ -452,4 +453,12 @@ final class ManiphestTask extends ManiphestDAO return array(); } + +/* -( PhabricatorFulltextInterface )--------------------------------------- */ + + + public function newFulltextEngine() { + return new ManiphestTaskFulltextEngine(); + } + } diff --git a/src/applications/passphrase/search/PassphraseCredentialFulltextEngine.php b/src/applications/passphrase/search/PassphraseCredentialFulltextEngine.php new file mode 100644 index 0000000000..72f11007bf --- /dev/null +++ b/src/applications/passphrase/search/PassphraseCredentialFulltextEngine.php @@ -0,0 +1,27 @@ +setDocumentTitle($credential->getName()); + + $document->addField( + PhabricatorSearchDocumentFieldType::FIELD_BODY, + $credential->getDescription()); + + $document->addRelationship( + $credential->getIsDestroyed() + ? PhabricatorSearchRelationship::RELATIONSHIP_CLOSED + : PhabricatorSearchRelationship::RELATIONSHIP_OPEN, + $credential->getPHID(), + PassphraseCredentialPHIDType::TYPECONST, + PhabricatorTime::getNow()); + } + +} diff --git a/src/applications/passphrase/search/PassphraseSearchIndexer.php b/src/applications/passphrase/search/PassphraseSearchIndexer.php deleted file mode 100644 index 097aeb2cc0..0000000000 --- a/src/applications/passphrase/search/PassphraseSearchIndexer.php +++ /dev/null @@ -1,34 +0,0 @@ -loadDocumentByPHID($phid); - - $doc = new PhabricatorSearchAbstractDocument(); - $doc->setPHID($credential->getPHID()); - $doc->setDocumentType(PassphraseCredentialPHIDType::TYPECONST); - $doc->setDocumentTitle($credential->getName()); - $doc->setDocumentCreated($credential->getDateCreated()); - $doc->setDocumentModified($credential->getDateModified()); - - $doc->addField( - PhabricatorSearchDocumentFieldType::FIELD_BODY, - $credential->getDescription()); - - $doc->addRelationship( - $credential->getIsDestroyed() - ? PhabricatorSearchRelationship::RELATIONSHIP_CLOSED - : PhabricatorSearchRelationship::RELATIONSHIP_OPEN, - $credential->getPHID(), - PassphraseCredentialPHIDType::TYPECONST, - time()); - - return $doc; - } - -} diff --git a/src/applications/passphrase/storage/PassphraseCredential.php b/src/applications/passphrase/storage/PassphraseCredential.php index 1c58ced82d..4d705aff83 100644 --- a/src/applications/passphrase/storage/PassphraseCredential.php +++ b/src/applications/passphrase/storage/PassphraseCredential.php @@ -7,7 +7,8 @@ final class PassphraseCredential extends PassphraseDAO PhabricatorFlaggableInterface, PhabricatorSubscribableInterface, PhabricatorDestructibleInterface, - PhabricatorSpacesInterface { + PhabricatorSpacesInterface, + PhabricatorFulltextInterface { protected $name; protected $credentialType; @@ -189,4 +190,13 @@ final class PassphraseCredential extends PassphraseDAO return $this->spacePHID; } + +/* -( PhabricatorFulltextInterface )--------------------------------------- */ + + + public function newFulltextEngine() { + return new PassphraseCredentialFulltextEngine(); + } + + } diff --git a/src/applications/people/search/PhabricatorUserFulltextEngine.php b/src/applications/people/search/PhabricatorUserFulltextEngine.php new file mode 100644 index 0000000000..577c2322e2 --- /dev/null +++ b/src/applications/people/search/PhabricatorUserFulltextEngine.php @@ -0,0 +1,22 @@ +setDocumentTitle($user->getFullName()); + + $document->addRelationship( + $user->isUserActivated() + ? PhabricatorSearchRelationship::RELATIONSHIP_OPEN + : PhabricatorSearchRelationship::RELATIONSHIP_CLOSED, + $user->getPHID(), + PhabricatorPeopleUserPHIDType::TYPECONST, + PhabricatorTime::getNow()); + } +} diff --git a/src/applications/people/search/PhabricatorUserSearchIndexer.php b/src/applications/people/search/PhabricatorUserSearchIndexer.php deleted file mode 100644 index 17c74ad4f9..0000000000 --- a/src/applications/people/search/PhabricatorUserSearchIndexer.php +++ /dev/null @@ -1,30 +0,0 @@ -loadDocumentByPHID($phid); - - $doc = new PhabricatorSearchAbstractDocument(); - $doc->setPHID($user->getPHID()); - $doc->setDocumentType(PhabricatorPeopleUserPHIDType::TYPECONST); - $doc->setDocumentTitle($user->getFullName()); - $doc->setDocumentCreated($user->getDateCreated()); - $doc->setDocumentModified($user->getDateModified()); - - $doc->addRelationship( - $user->isUserActivated() - ? PhabricatorSearchRelationship::RELATIONSHIP_OPEN - : PhabricatorSearchRelationship::RELATIONSHIP_CLOSED, - $user->getPHID(), - PhabricatorPeopleUserPHIDType::TYPECONST, - time()); - - return $doc; - } -} diff --git a/src/applications/people/storage/PhabricatorUser.php b/src/applications/people/storage/PhabricatorUser.php index 0961a1bfdd..c805eb2b5c 100644 --- a/src/applications/people/storage/PhabricatorUser.php +++ b/src/applications/people/storage/PhabricatorUser.php @@ -15,7 +15,8 @@ final class PhabricatorUser PhabricatorDestructibleInterface, PhabricatorSSHPublicKeyInterface, PhabricatorFlaggableInterface, - PhabricatorApplicationTransactionInterface { + PhabricatorApplicationTransactionInterface, + PhabricatorFulltextInterface { const SESSION_TABLE = 'phabricator_session'; const NAMETOKEN_TABLE = 'user_nametoken'; @@ -1308,4 +1309,12 @@ final class PhabricatorUser return $timeline; } + +/* -( PhabricatorFulltextInterface )--------------------------------------- */ + + + public function newFulltextEngine() { + return new PhabricatorUserFulltextEngine(); + } + } diff --git a/src/applications/pholio/search/PholioMockFulltextEngine.php b/src/applications/pholio/search/PholioMockFulltextEngine.php new file mode 100644 index 0000000000..9a162168db --- /dev/null +++ b/src/applications/pholio/search/PholioMockFulltextEngine.php @@ -0,0 +1,25 @@ +setDocumentTitle($mock->getName()); + + $document->addField( + PhabricatorSearchDocumentFieldType::FIELD_BODY, + $mock->getDescription()); + + $document->addRelationship( + PhabricatorSearchRelationship::RELATIONSHIP_AUTHOR, + $mock->getAuthorPHID(), + PhabricatorPeopleUserPHIDType::TYPECONST, + $mock->getDateCreated()); + } + +} diff --git a/src/applications/pholio/search/PholioSearchIndexer.php b/src/applications/pholio/search/PholioSearchIndexer.php deleted file mode 100644 index f9150f94a4..0000000000 --- a/src/applications/pholio/search/PholioSearchIndexer.php +++ /dev/null @@ -1,30 +0,0 @@ -loadDocumentByPHID($phid); - - $doc = $this->newDocument($phid) - ->setDocumentTitle($mock->getName()) - ->setDocumentCreated($mock->getDateCreated()) - ->setDocumentModified($mock->getDateModified()); - - $doc->addField( - PhabricatorSearchDocumentFieldType::FIELD_BODY, - $mock->getDescription()); - - $doc->addRelationship( - PhabricatorSearchRelationship::RELATIONSHIP_AUTHOR, - $mock->getAuthorPHID(), - PhabricatorPeopleUserPHIDType::TYPECONST, - $mock->getDateCreated()); - - return $doc; - } - -} diff --git a/src/applications/pholio/storage/PholioMock.php b/src/applications/pholio/storage/PholioMock.php index 71d1857383..6316d92cb9 100644 --- a/src/applications/pholio/storage/PholioMock.php +++ b/src/applications/pholio/storage/PholioMock.php @@ -11,7 +11,8 @@ final class PholioMock extends PholioDAO PhabricatorProjectInterface, PhabricatorDestructibleInterface, PhabricatorSpacesInterface, - PhabricatorMentionableInterface { + PhabricatorMentionableInterface, + PhabricatorFulltextInterface { const MARKUP_FIELD_DESCRIPTION = 'markup:description'; @@ -321,4 +322,12 @@ final class PholioMock extends PholioDAO } +/* -( PhabricatorFulltextInterface )--------------------------------------- */ + + + public function newFulltextEngine() { + return new PholioMockFulltextEngine(); + } + + } diff --git a/src/applications/phriction/search/PhrictionDocumentFulltextEngine.php b/src/applications/phriction/search/PhrictionDocumentFulltextEngine.php new file mode 100644 index 0000000000..a09994c0c3 --- /dev/null +++ b/src/applications/phriction/search/PhrictionDocumentFulltextEngine.php @@ -0,0 +1,44 @@ +setViewer($this->getViewer()) + ->withPHIDs(array($document->getPHID())) + ->needContent(true) + ->executeOne(); + + $content = $wiki->getContent(); + + $document->setDocumentTitle($content->getTitle()); + + // TODO: These are not quite correct, but we don't currently store the + // proper dates in a way that's easy to get to. + $document + ->setDocumentCreated($content->getDateCreated()) + ->setDocumentModified($content->getDateModified()); + + $document->addField( + PhabricatorSearchDocumentFieldType::FIELD_BODY, + $content->getContent()); + + $document->addRelationship( + PhabricatorSearchRelationship::RELATIONSHIP_AUTHOR, + $content->getAuthorPHID(), + PhabricatorPeopleUserPHIDType::TYPECONST, + $content->getDateCreated()); + + $document->addRelationship( + ($wiki->getStatus() == PhrictionDocumentStatus::STATUS_EXISTS) + ? PhabricatorSearchRelationship::RELATIONSHIP_OPEN + : PhabricatorSearchRelationship::RELATIONSHIP_CLOSED, + $wiki->getPHID(), + PhrictionDocumentPHIDType::TYPECONST, + PhabricatorTime::getNow()); + } +} diff --git a/src/applications/phriction/search/PhrictionSearchIndexer.php b/src/applications/phriction/search/PhrictionSearchIndexer.php deleted file mode 100644 index 28b7e34bbf..0000000000 --- a/src/applications/phriction/search/PhrictionSearchIndexer.php +++ /dev/null @@ -1,47 +0,0 @@ -loadDocumentByPHID($phid); - - $content = id(new PhrictionContent())->load($document->getContentID()); - $document->attachContent($content); - - $content = $document->getContent(); - - $doc = new PhabricatorSearchAbstractDocument(); - $doc->setPHID($document->getPHID()); - $doc->setDocumentType(PhrictionDocumentPHIDType::TYPECONST); - $doc->setDocumentTitle($content->getTitle()); - - // TODO: This isn't precisely correct, denormalize into the Document table? - $doc->setDocumentCreated($content->getDateCreated()); - $doc->setDocumentModified($content->getDateModified()); - - $doc->addField( - PhabricatorSearchDocumentFieldType::FIELD_BODY, - $content->getContent()); - - $doc->addRelationship( - PhabricatorSearchRelationship::RELATIONSHIP_AUTHOR, - $content->getAuthorPHID(), - PhabricatorPeopleUserPHIDType::TYPECONST, - $content->getDateCreated()); - - $doc->addRelationship( - ($document->getStatus() == PhrictionDocumentStatus::STATUS_EXISTS) - ? PhabricatorSearchRelationship::RELATIONSHIP_OPEN - : PhabricatorSearchRelationship::RELATIONSHIP_CLOSED, - $document->getPHID(), - PhrictionDocumentPHIDType::TYPECONST, - time()); - - return $doc; - } -} diff --git a/src/applications/phriction/storage/PhrictionDocument.php b/src/applications/phriction/storage/PhrictionDocument.php index f274d87ad4..3c883625b0 100644 --- a/src/applications/phriction/storage/PhrictionDocument.php +++ b/src/applications/phriction/storage/PhrictionDocument.php @@ -7,7 +7,8 @@ final class PhrictionDocument extends PhrictionDAO PhabricatorFlaggableInterface, PhabricatorTokenReceiverInterface, PhabricatorDestructibleInterface, - PhabricatorApplicationTransactionInterface { + PhabricatorApplicationTransactionInterface, + PhabricatorFulltextInterface { protected $slug; protected $depth; @@ -252,4 +253,12 @@ final class PhrictionDocument extends PhrictionDAO $this->saveTransaction(); } + +/* -( PhabricatorFulltextInterface )--------------------------------------- */ + + + public function newFulltextEngine() { + return new PhrictionDocumentFulltextEngine(); + } + } diff --git a/src/applications/ponder/search/PonderQuestionFulltextEngine.php b/src/applications/ponder/search/PonderQuestionFulltextEngine.php new file mode 100644 index 0000000000..6312d265d1 --- /dev/null +++ b/src/applications/ponder/search/PonderQuestionFulltextEngine.php @@ -0,0 +1,24 @@ +setDocumentTitle($question->getTitle()); + + $document->addField( + PhabricatorSearchDocumentFieldType::FIELD_BODY, + $question->getContent()); + + $document->addRelationship( + PhabricatorSearchRelationship::RELATIONSHIP_AUTHOR, + $question->getAuthorPHID(), + PhabricatorPeopleUserPHIDType::TYPECONST, + $question->getDateCreated()); + } +} diff --git a/src/applications/ponder/search/PonderSearchIndexer.php b/src/applications/ponder/search/PonderSearchIndexer.php deleted file mode 100644 index 8bdbee733b..0000000000 --- a/src/applications/ponder/search/PonderSearchIndexer.php +++ /dev/null @@ -1,42 +0,0 @@ -loadDocumentByPHID($phid); - - $doc = $this->newDocument($phid) - ->setDocumentTitle($question->getTitle()) - ->setDocumentCreated($question->getDateCreated()) - ->setDocumentModified($question->getDateModified()); - - $doc->addField( - PhabricatorSearchDocumentFieldType::FIELD_BODY, - $question->getContent()); - - $doc->addRelationship( - PhabricatorSearchRelationship::RELATIONSHIP_AUTHOR, - $question->getAuthorPHID(), - PhabricatorPeopleUserPHIDType::TYPECONST, - $question->getDateCreated()); - - $answers = id(new PonderAnswerQuery()) - ->setViewer($this->getViewer()) - ->withQuestionIDs(array($question->getID())) - ->execute(); - foreach ($answers as $answer) { - if (strlen($answer->getContent())) { - $doc->addField( - PhabricatorSearchDocumentFieldType::FIELD_COMMENT, - $answer->getContent()); - } - } - - return $doc; - } -} diff --git a/src/applications/ponder/storage/PonderQuestion.php b/src/applications/ponder/storage/PonderQuestion.php index f02823b273..bbce081d88 100644 --- a/src/applications/ponder/storage/PonderQuestion.php +++ b/src/applications/ponder/storage/PonderQuestion.php @@ -10,7 +10,8 @@ final class PonderQuestion extends PonderDAO PhabricatorTokenReceiverInterface, PhabricatorProjectInterface, PhabricatorDestructibleInterface, - PhabricatorSpacesInterface { + PhabricatorSpacesInterface, + PhabricatorFulltextInterface { const MARKUP_FIELD_CONTENT = 'markup:content'; @@ -291,4 +292,12 @@ final class PonderQuestion extends PonderDAO return $this->spacePHID; } + +/* -( PhabricatorFulltextInterface )--------------------------------------- */ + + + public function newFulltextEngine() { + return new PonderQuestionFulltextEngine(); + } + } diff --git a/src/applications/project/search/PhabricatorProjectFulltextEngine.php b/src/applications/project/search/PhabricatorProjectFulltextEngine.php new file mode 100644 index 0000000000..f0940286e5 --- /dev/null +++ b/src/applications/project/search/PhabricatorProjectFulltextEngine.php @@ -0,0 +1,24 @@ +updateDatasourceTokens(); + + $document->setDocumentTitle($project->getName()); + + $document->addRelationship( + $project->isArchived() + ? PhabricatorSearchRelationship::RELATIONSHIP_CLOSED + : PhabricatorSearchRelationship::RELATIONSHIP_OPEN, + $project->getPHID(), + PhabricatorProjectProjectPHIDType::TYPECONST, + PhabricatorTime::getNow()); + } + +} diff --git a/src/applications/project/search/PhabricatorProjectSearchIndexer.php b/src/applications/project/search/PhabricatorProjectSearchIndexer.php deleted file mode 100644 index a4fb7eaf87..0000000000 --- a/src/applications/project/search/PhabricatorProjectSearchIndexer.php +++ /dev/null @@ -1,35 +0,0 @@ -loadDocumentByPHID($phid); - $project->updateDatasourceTokens(); - - $doc = new PhabricatorSearchAbstractDocument(); - $doc->setPHID($project->getPHID()); - $doc->setDocumentType(PhabricatorProjectProjectPHIDType::TYPECONST); - $doc->setDocumentTitle($project->getName()); - $doc->setDocumentCreated($project->getDateCreated()); - $doc->setDocumentModified($project->getDateModified()); - - $doc->addRelationship( - $project->isArchived() - ? PhabricatorSearchRelationship::RELATIONSHIP_CLOSED - : PhabricatorSearchRelationship::RELATIONSHIP_OPEN, - $project->getPHID(), - PhabricatorProjectProjectPHIDType::TYPECONST, - time()); - - // NOTE: This could be more full-featured, but for now we're mostly - // interested in the side effects of indexing. - - return $doc; - } - -} diff --git a/src/applications/project/storage/PhabricatorProject.php b/src/applications/project/storage/PhabricatorProject.php index 8e4f3fbfc9..ba9d98c8d3 100644 --- a/src/applications/project/storage/PhabricatorProject.php +++ b/src/applications/project/storage/PhabricatorProject.php @@ -7,7 +7,8 @@ final class PhabricatorProject extends PhabricatorProjectDAO PhabricatorPolicyInterface, PhabricatorSubscribableInterface, PhabricatorCustomFieldInterface, - PhabricatorDestructibleInterface { + PhabricatorDestructibleInterface, + PhabricatorFulltextInterface { protected $name; protected $status = PhabricatorProjectStatus::STATUS_ACTIVE; @@ -387,6 +388,7 @@ final class PhabricatorProject extends PhabricatorProjectDAO /* -( PhabricatorDestructibleInterface )----------------------------------- */ + public function destroyObjectPermanently( PhabricatorDestructionEngine $engine) { @@ -408,4 +410,12 @@ final class PhabricatorProject extends PhabricatorProjectDAO $this->saveTransaction(); } + +/* -( PhabricatorFulltextInterface )--------------------------------------- */ + + + public function newFulltextEngine() { + return new PhabricatorProjectFulltextEngine(); + } + } diff --git a/src/applications/repository/search/DiffusionCommitFulltextEngine.php b/src/applications/repository/search/DiffusionCommitFulltextEngine.php new file mode 100644 index 0000000000..51d2ead5fa --- /dev/null +++ b/src/applications/repository/search/DiffusionCommitFulltextEngine.php @@ -0,0 +1,49 @@ +setViewer($this->getViewer()) + ->withPHIDs(array($object->getPHID())) + ->needCommitData(true) + ->executeOne(); + + $repository = $commit->getRepository(); + $commit_data = $commit->getCommitData(); + + $date_created = $commit->getEpoch(); + $commit_message = $commit_data->getCommitMessage(); + $author_phid = $commit_data->getCommitDetail('authorPHID'); + + $title = 'r'.$repository->getCallsign().$commit->getCommitIdentifier(). + ' '.$commit_data->getSummary(); + + $document + ->setDocumentCreated($date_created) + ->setDocumentModified($date_created) + ->setDocumentTitle($title); + + $document->addField( + PhabricatorSearchDocumentFieldType::FIELD_BODY, + $commit_message); + + if ($author_phid) { + $document->addRelationship( + PhabricatorSearchRelationship::RELATIONSHIP_AUTHOR, + $author_phid, + PhabricatorPeopleUserPHIDType::TYPECONST, + $date_created); + } + + $document->addRelationship( + PhabricatorSearchRelationship::RELATIONSHIP_REPOSITORY, + $repository->getPHID(), + PhabricatorRepositoryRepositoryPHIDType::TYPECONST, + $date_created); + } +} diff --git a/src/applications/repository/search/PhabricatorRepositoryCommitSearchIndexer.php b/src/applications/repository/search/PhabricatorRepositoryCommitSearchIndexer.php deleted file mode 100644 index 7e2488cfc1..0000000000 --- a/src/applications/repository/search/PhabricatorRepositoryCommitSearchIndexer.php +++ /dev/null @@ -1,58 +0,0 @@ -loadDocumentByPHID($phid); - - $commit_data = id(new PhabricatorRepositoryCommitData())->loadOneWhere( - 'commitID = %d', - $commit->getID()); - $date_created = $commit->getEpoch(); - $commit_message = $commit_data->getCommitMessage(); - $author_phid = $commit_data->getCommitDetail('authorPHID'); - - $repository = id(new PhabricatorRepositoryQuery()) - ->setViewer($this->getViewer()) - ->withIDs(array($commit->getRepositoryID())) - ->executeOne(); - if (!$repository) { - throw new Exception(pht('No such repository!')); - } - - $title = 'r'.$repository->getCallsign().$commit->getCommitIdentifier(). - ' '.$commit_data->getSummary(); - - $doc = new PhabricatorSearchAbstractDocument(); - $doc->setPHID($commit->getPHID()); - $doc->setDocumentType(PhabricatorRepositoryCommitPHIDType::TYPECONST); - $doc->setDocumentCreated($date_created); - $doc->setDocumentModified($date_created); - $doc->setDocumentTitle($title); - - $doc->addField( - PhabricatorSearchDocumentFieldType::FIELD_BODY, - $commit_message); - - if ($author_phid) { - $doc->addRelationship( - PhabricatorSearchRelationship::RELATIONSHIP_AUTHOR, - $author_phid, - PhabricatorPeopleUserPHIDType::TYPECONST, - $date_created); - } - - $doc->addRelationship( - PhabricatorSearchRelationship::RELATIONSHIP_REPOSITORY, - $repository->getPHID(), - PhabricatorRepositoryRepositoryPHIDType::TYPECONST, - $date_created); - - return $doc; - } -} diff --git a/src/applications/repository/storage/PhabricatorRepositoryCommit.php b/src/applications/repository/storage/PhabricatorRepositoryCommit.php index 531bac9dad..da6d56b915 100644 --- a/src/applications/repository/storage/PhabricatorRepositoryCommit.php +++ b/src/applications/repository/storage/PhabricatorRepositoryCommit.php @@ -11,7 +11,8 @@ final class PhabricatorRepositoryCommit PhabricatorMentionableInterface, HarbormasterBuildableInterface, PhabricatorCustomFieldInterface, - PhabricatorApplicationTransactionInterface { + PhabricatorApplicationTransactionInterface, + PhabricatorFulltextInterface { protected $repositoryID; protected $phid; @@ -437,4 +438,11 @@ final class PhabricatorRepositoryCommit return $timeline->setPathMap($path_map); } +/* -( PhabricatorFulltextInterface )--------------------------------------- */ + + + public function newFulltextEngine() { + return new DiffusionCommitFulltextEngine(); + } + } diff --git a/src/applications/search/engineextension/PhabricatorFulltextIndexEngineExtension.php b/src/applications/search/engineextension/PhabricatorFulltextIndexEngineExtension.php new file mode 100644 index 0000000000..19837043a5 --- /dev/null +++ b/src/applications/search/engineextension/PhabricatorFulltextIndexEngineExtension.php @@ -0,0 +1,30 @@ +newFulltextEngine(); + if (!$engine) { + return; + } + + $engine->setObject($object); + + $engine->buildFulltextIndexes(); + } + +} diff --git a/src/applications/search/engineextension/PhabricatorLiskFulltextEngineExtension.php b/src/applications/search/engineextension/PhabricatorLiskFulltextEngineExtension.php new file mode 100644 index 0000000000..9cbe384a10 --- /dev/null +++ b/src/applications/search/engineextension/PhabricatorLiskFulltextEngineExtension.php @@ -0,0 +1,34 @@ +getConfigOption(LiskDAO::CONFIG_TIMESTAMPS)) { + return false; + } + + return true; + } + + public function indexFulltextObject( + $object, + PhabricatorSearchAbstractDocument $document) { + + $document + ->setDocumentCreated($object->getDateCreated()) + ->setDocumentModified($object->getDateModified()); + + } + +} diff --git a/src/applications/search/index/PhabricatorFulltextEngine.php b/src/applications/search/index/PhabricatorFulltextEngine.php new file mode 100644 index 0000000000..c592fc0354 --- /dev/null +++ b/src/applications/search/index/PhabricatorFulltextEngine.php @@ -0,0 +1,54 @@ +object = $object; + return $this; + } + + public function getObject() { + return $this->object; + } + + protected function getViewer() { + return PhabricatorUser::getOmnipotentUser(); + } + + abstract protected function buildAbstractDocument( + PhabricatorSearchAbstractDocument $document, + $object); + + final public function buildFulltextIndexes() { + $object = $this->getObject(); + + $extensions = PhabricatorFulltextEngineExtension::getAllExtensions(); + foreach ($extensions as $key => $extension) { + if (!$extension->shouldIndexFulltextObject($object)) { + unset($extensions[$key]); + } + } + + $document = $this->newAbstractDocument($object); + + $this->buildAbstractDocument($document, $object); + + foreach ($extensions as $extension) { + $extension->indexFulltextObject($object, $document); + } + + $storage_engine = PhabricatorSearchEngine::loadEngine(); + $storage_engine->reindexAbstractDocument($document); + } + + protected function newAbstractDocument($object) { + $phid = $object->getPHID(); + return id(new PhabricatorSearchAbstractDocument()) + ->setPHID($phid) + ->setDocumentType(phid_get_type($phid)); + } + +} diff --git a/src/applications/search/index/PhabricatorIndexEngine.php b/src/applications/search/index/PhabricatorIndexEngine.php index cd4effd069..dda9af0d41 100644 --- a/src/applications/search/index/PhabricatorIndexEngine.php +++ b/src/applications/search/index/PhabricatorIndexEngine.php @@ -96,19 +96,4 @@ final class PhabricatorIndexEngine extends Phobject { return $extensions; } - public function indexDocumentByPHID($phid) { - $indexers = id(new PhutilClassMapQuery()) - ->setAncestorClass('PhabricatorSearchDocumentIndexer') - ->execute(); - - foreach ($indexers as $indexer) { - if ($indexer->shouldIndexDocumentByPHID($phid)) { - $indexer->indexDocumentByPHID($phid); - break; - } - } - - return $this; - } - } diff --git a/src/applications/search/index/PhabricatorSearchDocumentIndexer.php b/src/applications/search/index/PhabricatorSearchDocumentIndexer.php deleted file mode 100644 index b2a6d868ea..0000000000 --- a/src/applications/search/index/PhabricatorSearchDocumentIndexer.php +++ /dev/null @@ -1,65 +0,0 @@ -getIndexableObject(); - return (phid_get_type($phid) == phid_get_type($object->generatePHID())); - } - - public function getIndexIterator() { - $object = $this->getIndexableObject(); - return new LiskMigrationIterator($object); - } - - protected function loadDocumentByPHID($phid) { - $object = id(new PhabricatorObjectQuery()) - ->setViewer($this->getViewer()) - ->withPHIDs(array($phid)) - ->executeOne(); - if (!$object) { - throw new Exception(pht("Unable to load object by PHID '%s'!", $phid)); - } - return $object; - } - - public function indexDocumentByPHID($phid) { - $document = $this->buildAbstractDocumentByPHID($phid); - if ($document === null) { - // This indexer doesn't build a document index, so we're done. - return $this; - } - - $object = $this->loadDocumentByPHID($phid); - - $extensions = PhabricatorFulltextEngineExtension::getAllExtensions(); - foreach ($extensions as $key => $extension) { - if (!$extension->shouldIndexFulltextObject($object)) { - unset($extensions[$key]); - } - } - - foreach ($extensions as $extension) { - $extension->indexFulltextObject($object, $document); - } - - $engine = PhabricatorSearchEngine::loadEngine(); - $engine->reindexAbstractDocument($document); - - return $this; - } - - protected function newDocument($phid) { - return id(new PhabricatorSearchAbstractDocument()) - ->setPHID($phid) - ->setDocumentType(phid_get_type($phid)); - } - -} diff --git a/src/applications/search/interface/PhabricatorFulltextInterface.php b/src/applications/search/interface/PhabricatorFulltextInterface.php new file mode 100644 index 0000000000..5cbde615b2 --- /dev/null +++ b/src/applications/search/interface/PhabricatorFulltextInterface.php @@ -0,0 +1,7 @@ +setSynopsis(pht('Build or rebuild search indexes.')) ->setExamples( "**index** D123\n". - "**index** --type DREV\n". + "**index** --type task\n". "**index** --all") ->setArguments( array( @@ -19,8 +19,9 @@ final class PhabricatorSearchManagementIndexWorkflow ), array( 'name' => 'type', - 'param' => 'TYPE', - 'help' => pht('PHID type to reindex, like "TASK" or "DREV".'), + 'param' => 'type', + 'help' => pht( + 'Object types to reindex, like "task", "commit" or "revision".'), ), array( 'name' => 'background', @@ -146,20 +147,49 @@ final class PhabricatorSearchManagementIndexWorkflow } private function loadPHIDsByTypes($type) { - $indexers = id(new PhutilClassMapQuery()) - ->setAncestorClass('PhabricatorSearchDocumentIndexer') + $objects = id(new PhutilClassMapQuery()) + ->setAncestorClass('PhabricatorFulltextInterface') ->execute(); - $phids = array(); - foreach ($indexers as $indexer) { - $indexer_phid = $indexer->getIndexableObject()->generatePHID(); - $indexer_type = phid_get_type($indexer_phid); + $normalized_type = phutil_utf8_strtolower($type); - if ($type && strcasecmp($indexer_type, $type)) { - continue; + $matches = array(); + foreach ($objects as $object) { + $object_class = get_class($object); + $normalized_class = phutil_utf8_strtolower($object_class); + + if (!strlen($type) || + strpos($normalized_class, $normalized_type) !== false) { + $matches[$object_class] = $object; } + } - $iterator = $indexer->getIndexIterator(); + if (!$matches) { + $all_types = array(); + foreach ($objects as $object) { + $all_types[] = get_class($object); + } + sort($all_types); + + throw new PhutilArgumentUsageException( + pht( + 'Type "%s" matches no indexable objects. Supported types are: %s.', + $type, + implode(', ', $all_types))); + } + + if ((count($matches) > 1) && strlen($type)) { + throw new PhutilArgumentUsageException( + pht( + 'Type "%s" matches multiple indexable objects. Use a more '. + 'specific string. Matching object types are: %s.', + $type, + implode(', ', array_keys($matches)))); + } + + $phids = array(); + foreach ($matches as $match) { + $iterator = new LiskMigrationIterator($match); foreach ($iterator as $object) { $phids[] = $object->getPHID(); } @@ -168,4 +198,5 @@ final class PhabricatorSearchManagementIndexWorkflow return $phids; } + } diff --git a/src/applications/search/query/PhabricatorSearchApplicationSearchEngine.php b/src/applications/search/query/PhabricatorSearchApplicationSearchEngine.php index 731edbfb04..e1502294d3 100644 --- a/src/applications/search/query/PhabricatorSearchApplicationSearchEngine.php +++ b/src/applications/search/query/PhabricatorSearchApplicationSearchEngine.php @@ -204,10 +204,16 @@ final class PhabricatorSearchApplicationSearchEngine // TODO: This is inelegant and not very efficient, but gets us reasonable // results. It would be nice to do this more elegantly. - $indexers = id(new PhutilClassMapQuery()) - ->setAncestorClass('PhabricatorSearchDocumentIndexer') + $objects = id(new PhutilClassMapQuery()) + ->setAncestorClass('PhabricatorFulltextInterface') ->execute(); + $type_map = array(); + foreach ($objects as $object) { + $phid_type = phid_get_type($object->generatePHID()); + $type_map[$phid_type] = $object; + } + if ($viewer) { $types = PhabricatorPHIDType::getAllInstalledTypes($viewer); } else { @@ -217,11 +223,9 @@ final class PhabricatorSearchApplicationSearchEngine $results = array(); foreach ($types as $type) { $typeconst = $type->getTypeConstant(); - foreach ($indexers as $indexer) { - $fake_phid = 'PHID-'.$typeconst.'-fake'; - if ($indexer->shouldIndexDocumentByPHID($fake_phid)) { - $results[$typeconst] = $type->getTypeName(); - } + $object = idx($type_map, $typeconst); + if ($object) { + $results[$typeconst] = $type->getTypeName(); } } diff --git a/src/applications/search/worker/PhabricatorSearchWorker.php b/src/applications/search/worker/PhabricatorSearchWorker.php index 86ba11c2cb..607baed69a 100644 --- a/src/applications/search/worker/PhabricatorSearchWorker.php +++ b/src/applications/search/worker/PhabricatorSearchWorker.php @@ -47,8 +47,6 @@ final class PhabricatorSearchWorker extends PhabricatorWorker { $engine->setObject($object); $engine->indexObject(); - - $engine->indexDocumentByPHID($object->getPHID()); } catch (Exception $ex) { $lock->unlock();