@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Convert all "DocumentIndexers" into "FulltextEngines"

Summary: Ref T9979. This simplifies/standardizes the code a bit, but mostly gives us more consistent class names and structure.

Test Plan:
- Used `bin/search index --type ...` to index documents of every indexable type.
- Searched for documents by unique text, found them.

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T9979

Differential Revision: https://secure.phabricator.com/D14842

+799 -700
+46 -28
src/__phutil_library_map__.php
··· 482 482 'DifferentialRevisionDependsOnRevisionEdgeType' => 'applications/differential/edge/DifferentialRevisionDependsOnRevisionEdgeType.php', 483 483 'DifferentialRevisionDetailView' => 'applications/differential/view/DifferentialRevisionDetailView.php', 484 484 'DifferentialRevisionEditController' => 'applications/differential/controller/DifferentialRevisionEditController.php', 485 + 'DifferentialRevisionFulltextEngine' => 'applications/differential/search/DifferentialRevisionFulltextEngine.php', 485 486 'DifferentialRevisionHasCommitEdgeType' => 'applications/differential/edge/DifferentialRevisionHasCommitEdgeType.php', 486 487 'DifferentialRevisionHasReviewerEdgeType' => 'applications/differential/edge/DifferentialRevisionHasReviewerEdgeType.php', 487 488 'DifferentialRevisionHasTaskEdgeType' => 'applications/differential/edge/DifferentialRevisionHasTaskEdgeType.php', ··· 507 508 'DifferentialRevisionUpdateHistoryView' => 'applications/differential/view/DifferentialRevisionUpdateHistoryView.php', 508 509 'DifferentialRevisionViewController' => 'applications/differential/controller/DifferentialRevisionViewController.php', 509 510 'DifferentialSchemaSpec' => 'applications/differential/storage/DifferentialSchemaSpec.php', 510 - 'DifferentialSearchIndexer' => 'applications/differential/search/DifferentialSearchIndexer.php', 511 511 'DifferentialSetDiffPropertyConduitAPIMethod' => 'applications/differential/conduit/DifferentialSetDiffPropertyConduitAPIMethod.php', 512 512 'DifferentialStoredCustomField' => 'applications/differential/customfield/DifferentialStoredCustomField.php', 513 513 'DifferentialSubscribersField' => 'applications/differential/customfield/DifferentialSubscribersField.php', ··· 556 556 'DiffusionCommitDiffContentRemovedHeraldField' => 'applications/diffusion/herald/DiffusionCommitDiffContentRemovedHeraldField.php', 557 557 'DiffusionCommitDiffEnormousHeraldField' => 'applications/diffusion/herald/DiffusionCommitDiffEnormousHeraldField.php', 558 558 'DiffusionCommitEditController' => 'applications/diffusion/controller/DiffusionCommitEditController.php', 559 + 'DiffusionCommitFulltextEngine' => 'applications/repository/search/DiffusionCommitFulltextEngine.php', 559 560 'DiffusionCommitHasRevisionEdgeType' => 'applications/diffusion/edge/DiffusionCommitHasRevisionEdgeType.php', 560 561 'DiffusionCommitHasTaskEdgeType' => 'applications/diffusion/edge/DiffusionCommitHasTaskEdgeType.php', 561 562 'DiffusionCommitHash' => 'applications/diffusion/data/DiffusionCommitHash.php', ··· 770 771 'DivinerAtomQuery' => 'applications/diviner/query/DivinerAtomQuery.php', 771 772 'DivinerAtomRef' => 'applications/diviner/atom/DivinerAtomRef.php', 772 773 'DivinerAtomSearchEngine' => 'applications/diviner/query/DivinerAtomSearchEngine.php', 773 - 'DivinerAtomSearchIndexer' => 'applications/diviner/search/DivinerAtomSearchIndexer.php', 774 774 'DivinerAtomizeWorkflow' => 'applications/diviner/workflow/DivinerAtomizeWorkflow.php', 775 775 'DivinerAtomizer' => 'applications/diviner/atomizer/DivinerAtomizer.php', 776 776 'DivinerBookController' => 'applications/diviner/controller/DivinerBookController.php', ··· 779 779 'DivinerBookItemView' => 'applications/diviner/view/DivinerBookItemView.php', 780 780 'DivinerBookPHIDType' => 'applications/diviner/phid/DivinerBookPHIDType.php', 781 781 'DivinerBookQuery' => 'applications/diviner/query/DivinerBookQuery.php', 782 - 'DivinerBookSearchIndexer' => 'applications/diviner/search/DivinerBookSearchIndexer.php', 783 782 'DivinerController' => 'applications/diviner/controller/DivinerController.php', 784 783 'DivinerDAO' => 'applications/diviner/storage/DivinerDAO.php', 785 784 'DivinerDefaultEditCapability' => 'applications/diviner/capability/DivinerDefaultEditCapability.php', ··· 792 791 'DivinerLiveAtom' => 'applications/diviner/storage/DivinerLiveAtom.php', 793 792 'DivinerLiveBook' => 'applications/diviner/storage/DivinerLiveBook.php', 794 793 'DivinerLiveBookEditor' => 'applications/diviner/editor/DivinerLiveBookEditor.php', 794 + 'DivinerLiveBookFulltextEngine' => 'applications/diviner/search/DivinerLiveBookFulltextEngine.php', 795 795 'DivinerLiveBookTransaction' => 'applications/diviner/storage/DivinerLiveBookTransaction.php', 796 796 'DivinerLiveBookTransactionQuery' => 'applications/diviner/query/DivinerLiveBookTransactionQuery.php', 797 797 'DivinerLivePublisher' => 'applications/diviner/publisher/DivinerLivePublisher.php', 798 798 'DivinerLiveSymbol' => 'applications/diviner/storage/DivinerLiveSymbol.php', 799 + 'DivinerLiveSymbolFulltextEngine' => 'applications/diviner/search/DivinerLiveSymbolFulltextEngine.php', 799 800 'DivinerMainController' => 'applications/diviner/controller/DivinerMainController.php', 800 801 'DivinerPHPAtomizer' => 'applications/diviner/atomizer/DivinerPHPAtomizer.php', 801 802 'DivinerParameterTableView' => 'applications/diviner/view/DivinerParameterTableView.php', ··· 986 987 'FundInitiativeCloseController' => 'applications/fund/controller/FundInitiativeCloseController.php', 987 988 'FundInitiativeEditController' => 'applications/fund/controller/FundInitiativeEditController.php', 988 989 'FundInitiativeEditor' => 'applications/fund/editor/FundInitiativeEditor.php', 989 - 'FundInitiativeIndexer' => 'applications/fund/search/FundInitiativeIndexer.php', 990 + 'FundInitiativeFulltextEngine' => 'applications/fund/search/FundInitiativeFulltextEngine.php', 990 991 'FundInitiativeListController' => 'applications/fund/controller/FundInitiativeListController.php', 991 992 'FundInitiativePHIDType' => 'applications/fund/phid/FundInitiativePHIDType.php', 992 993 'FundInitiativeQuery' => 'applications/fund/query/FundInitiativeQuery.php', ··· 1304 1305 'ManiphestReportController' => 'applications/maniphest/controller/ManiphestReportController.php', 1305 1306 'ManiphestSchemaSpec' => 'applications/maniphest/storage/ManiphestSchemaSpec.php', 1306 1307 'ManiphestSearchConduitAPIMethod' => 'applications/maniphest/conduit/ManiphestSearchConduitAPIMethod.php', 1307 - 'ManiphestSearchIndexer' => 'applications/maniphest/search/ManiphestSearchIndexer.php', 1308 1308 'ManiphestStatusConfigOptionType' => 'applications/maniphest/config/ManiphestStatusConfigOptionType.php', 1309 1309 'ManiphestStatusEmailCommand' => 'applications/maniphest/command/ManiphestStatusEmailCommand.php', 1310 1310 'ManiphestSubpriorityController' => 'applications/maniphest/controller/ManiphestSubpriorityController.php', ··· 1322 1322 'ManiphestTaskDetailController' => 'applications/maniphest/controller/ManiphestTaskDetailController.php', 1323 1323 'ManiphestTaskEditBulkJobType' => 'applications/maniphest/bulk/ManiphestTaskEditBulkJobType.php', 1324 1324 'ManiphestTaskEditController' => 'applications/maniphest/controller/ManiphestTaskEditController.php', 1325 + 'ManiphestTaskFulltextEngine' => 'applications/maniphest/search/ManiphestTaskFulltextEngine.php', 1325 1326 'ManiphestTaskHasCommitEdgeType' => 'applications/maniphest/edge/ManiphestTaskHasCommitEdgeType.php', 1326 1327 'ManiphestTaskHasMockEdgeType' => 'applications/maniphest/edge/ManiphestTaskHasMockEdgeType.php', 1327 1328 'ManiphestTaskHasRevisionEdgeType' => 'applications/maniphest/edge/ManiphestTaskHasRevisionEdgeType.php', ··· 1537 1538 'PassphraseCredentialCreateController' => 'applications/passphrase/controller/PassphraseCredentialCreateController.php', 1538 1539 'PassphraseCredentialDestroyController' => 'applications/passphrase/controller/PassphraseCredentialDestroyController.php', 1539 1540 'PassphraseCredentialEditController' => 'applications/passphrase/controller/PassphraseCredentialEditController.php', 1541 + 'PassphraseCredentialFulltextEngine' => 'applications/passphrase/search/PassphraseCredentialFulltextEngine.php', 1540 1542 'PassphraseCredentialListController' => 'applications/passphrase/controller/PassphraseCredentialListController.php', 1541 1543 'PassphraseCredentialLockController' => 'applications/passphrase/controller/PassphraseCredentialLockController.php', 1542 1544 'PassphraseCredentialPHIDType' => 'applications/passphrase/phid/PassphraseCredentialPHIDType.php', ··· 1564 1566 'PassphraseSSHPrivateKeyFileCredentialType' => 'applications/passphrase/credentialtype/PassphraseSSHPrivateKeyFileCredentialType.php', 1565 1567 'PassphraseSSHPrivateKeyTextCredentialType' => 'applications/passphrase/credentialtype/PassphraseSSHPrivateKeyTextCredentialType.php', 1566 1568 'PassphraseSchemaSpec' => 'applications/passphrase/storage/PassphraseSchemaSpec.php', 1567 - 'PassphraseSearchIndexer' => 'applications/passphrase/search/PassphraseSearchIndexer.php', 1568 1569 'PassphraseSecret' => 'applications/passphrase/storage/PassphraseSecret.php', 1569 1570 'PasteConduitAPIMethod' => 'applications/paste/conduit/PasteConduitAPIMethod.php', 1570 1571 'PasteCreateConduitAPIMethod' => 'applications/paste/conduit/PasteCreateConduitAPIMethod.php', ··· 1841 1842 'PhabricatorCalendarEventEditController' => 'applications/calendar/controller/PhabricatorCalendarEventEditController.php', 1842 1843 'PhabricatorCalendarEventEditor' => 'applications/calendar/editor/PhabricatorCalendarEventEditor.php', 1843 1844 'PhabricatorCalendarEventEmailCommand' => 'applications/calendar/command/PhabricatorCalendarEventEmailCommand.php', 1845 + 'PhabricatorCalendarEventFulltextEngine' => 'applications/calendar/search/PhabricatorCalendarEventFulltextEngine.php', 1844 1846 'PhabricatorCalendarEventInvitee' => 'applications/calendar/storage/PhabricatorCalendarEventInvitee.php', 1845 1847 'PhabricatorCalendarEventInviteeQuery' => 'applications/calendar/query/PhabricatorCalendarEventInviteeQuery.php', 1846 1848 'PhabricatorCalendarEventJoinController' => 'applications/calendar/controller/PhabricatorCalendarEventJoinController.php', ··· 1850 1852 'PhabricatorCalendarEventQuery' => 'applications/calendar/query/PhabricatorCalendarEventQuery.php', 1851 1853 'PhabricatorCalendarEventRSVPEmailCommand' => 'applications/calendar/command/PhabricatorCalendarEventRSVPEmailCommand.php', 1852 1854 'PhabricatorCalendarEventSearchEngine' => 'applications/calendar/query/PhabricatorCalendarEventSearchEngine.php', 1853 - 'PhabricatorCalendarEventSearchIndexer' => 'applications/calendar/search/PhabricatorCalendarEventSearchIndexer.php', 1854 1855 'PhabricatorCalendarEventTransaction' => 'applications/calendar/storage/PhabricatorCalendarEventTransaction.php', 1855 1856 'PhabricatorCalendarEventTransactionComment' => 'applications/calendar/storage/PhabricatorCalendarEventTransactionComment.php', 1856 1857 'PhabricatorCalendarEventTransactionQuery' => 'applications/calendar/query/PhabricatorCalendarEventTransactionQuery.php', ··· 2327 2328 'PhabricatorFlaggableInterface' => 'applications/flag/interface/PhabricatorFlaggableInterface.php', 2328 2329 'PhabricatorFlagsApplication' => 'applications/flag/application/PhabricatorFlagsApplication.php', 2329 2330 'PhabricatorFlagsUIEventListener' => 'applications/flag/events/PhabricatorFlagsUIEventListener.php', 2331 + 'PhabricatorFulltextEngine' => 'applications/search/index/PhabricatorFulltextEngine.php', 2330 2332 'PhabricatorFulltextEngineExtension' => 'applications/search/index/PhabricatorFulltextEngineExtension.php', 2331 2333 'PhabricatorFulltextEngineExtensionModule' => 'applications/search/index/PhabricatorFulltextEngineExtensionModule.php', 2334 + 'PhabricatorFulltextIndexEngineExtension' => 'applications/search/engineextension/PhabricatorFulltextIndexEngineExtension.php', 2335 + 'PhabricatorFulltextInterface' => 'applications/search/interface/PhabricatorFulltextInterface.php', 2332 2336 'PhabricatorFundApplication' => 'applications/fund/application/PhabricatorFundApplication.php', 2333 2337 'PhabricatorGDSetupCheck' => 'applications/config/check/PhabricatorGDSetupCheck.php', 2334 2338 'PhabricatorGarbageCollector' => 'infrastructure/daemon/garbagecollector/PhabricatorGarbageCollector.php', ··· 2407 2411 'PhabricatorLipsumManagementWorkflow' => 'applications/lipsum/management/PhabricatorLipsumManagementWorkflow.php', 2408 2412 'PhabricatorLipsumMondrianArtist' => 'applications/lipsum/image/PhabricatorLipsumMondrianArtist.php', 2409 2413 'PhabricatorLiskDAO' => 'infrastructure/storage/lisk/PhabricatorLiskDAO.php', 2414 + 'PhabricatorLiskFulltextEngineExtension' => 'applications/search/engineextension/PhabricatorLiskFulltextEngineExtension.php', 2410 2415 'PhabricatorLiskSearchEngineExtension' => 'applications/search/engineextension/PhabricatorLiskSearchEngineExtension.php', 2411 2416 'PhabricatorLiskSerializer' => 'infrastructure/storage/lisk/PhabricatorLiskSerializer.php', 2412 2417 'PhabricatorListFilterUIExample' => 'applications/uiexample/examples/PhabricatorListFilterUIExample.php', ··· 2832 2837 'PhabricatorProjectEditPictureController' => 'applications/project/controller/PhabricatorProjectEditPictureController.php', 2833 2838 'PhabricatorProjectEditorTestCase' => 'applications/project/editor/__tests__/PhabricatorProjectEditorTestCase.php', 2834 2839 'PhabricatorProjectFeedController' => 'applications/project/controller/PhabricatorProjectFeedController.php', 2840 + 'PhabricatorProjectFulltextEngine' => 'applications/project/search/PhabricatorProjectFulltextEngine.php', 2835 2841 'PhabricatorProjectHeraldAction' => 'applications/project/herald/PhabricatorProjectHeraldAction.php', 2836 2842 'PhabricatorProjectIconSet' => 'applications/project/icon/PhabricatorProjectIconSet.php', 2837 2843 'PhabricatorProjectInterface' => 'applications/project/interface/PhabricatorProjectInterface.php', ··· 2860 2866 'PhabricatorProjectSchemaSpec' => 'applications/project/storage/PhabricatorProjectSchemaSpec.php', 2861 2867 'PhabricatorProjectSearchEngine' => 'applications/project/query/PhabricatorProjectSearchEngine.php', 2862 2868 'PhabricatorProjectSearchField' => 'applications/project/searchfield/PhabricatorProjectSearchField.php', 2863 - 'PhabricatorProjectSearchIndexer' => 'applications/project/search/PhabricatorProjectSearchIndexer.php', 2864 2869 'PhabricatorProjectSlug' => 'applications/project/storage/PhabricatorProjectSlug.php', 2865 2870 'PhabricatorProjectStandardCustomField' => 'applications/project/customfield/PhabricatorProjectStandardCustomField.php', 2866 2871 'PhabricatorProjectStatus' => 'applications/project/constants/PhabricatorProjectStatus.php', ··· 2914 2919 'PhabricatorRepositoryCommitPHIDType' => 'applications/repository/phid/PhabricatorRepositoryCommitPHIDType.php', 2915 2920 'PhabricatorRepositoryCommitParserWorker' => 'applications/repository/worker/PhabricatorRepositoryCommitParserWorker.php', 2916 2921 'PhabricatorRepositoryCommitRef' => 'applications/repository/engine/PhabricatorRepositoryCommitRef.php', 2917 - 'PhabricatorRepositoryCommitSearchIndexer' => 'applications/repository/search/PhabricatorRepositoryCommitSearchIndexer.php', 2918 2922 'PhabricatorRepositoryConfigOptions' => 'applications/repository/config/PhabricatorRepositoryConfigOptions.php', 2919 2923 'PhabricatorRepositoryDAO' => 'applications/repository/storage/PhabricatorRepositoryDAO.php', 2920 2924 'PhabricatorRepositoryDiscoveryEngine' => 'applications/repository/engine/PhabricatorRepositoryDiscoveryEngine.php', ··· 3026 3030 'PhabricatorSearchDocument' => 'applications/search/storage/document/PhabricatorSearchDocument.php', 3027 3031 'PhabricatorSearchDocumentField' => 'applications/search/storage/document/PhabricatorSearchDocumentField.php', 3028 3032 'PhabricatorSearchDocumentFieldType' => 'applications/search/constants/PhabricatorSearchDocumentFieldType.php', 3029 - 'PhabricatorSearchDocumentIndexer' => 'applications/search/index/PhabricatorSearchDocumentIndexer.php', 3030 3033 'PhabricatorSearchDocumentQuery' => 'applications/search/query/PhabricatorSearchDocumentQuery.php', 3031 3034 'PhabricatorSearchDocumentRelationship' => 'applications/search/storage/document/PhabricatorSearchDocumentRelationship.php', 3032 3035 'PhabricatorSearchDocumentTypeDatasource' => 'applications/search/typeahead/PhabricatorSearchDocumentTypeDatasource.php', ··· 3285 3288 'PhabricatorUserEditorTestCase' => 'applications/people/editor/__tests__/PhabricatorUserEditorTestCase.php', 3286 3289 'PhabricatorUserEmail' => 'applications/people/storage/PhabricatorUserEmail.php', 3287 3290 'PhabricatorUserEmailTestCase' => 'applications/people/storage/__tests__/PhabricatorUserEmailTestCase.php', 3291 + 'PhabricatorUserFulltextEngine' => 'applications/people/search/PhabricatorUserFulltextEngine.php', 3288 3292 'PhabricatorUserLog' => 'applications/people/storage/PhabricatorUserLog.php', 3289 3293 'PhabricatorUserLogView' => 'applications/people/view/PhabricatorUserLogView.php', 3290 3294 'PhabricatorUserPHIDResolver' => 'applications/phid/resolver/PhabricatorUserPHIDResolver.php', ··· 3294 3298 'PhabricatorUserRealNameField' => 'applications/people/customfield/PhabricatorUserRealNameField.php', 3295 3299 'PhabricatorUserRolesField' => 'applications/people/customfield/PhabricatorUserRolesField.php', 3296 3300 'PhabricatorUserSchemaSpec' => 'applications/people/storage/PhabricatorUserSchemaSpec.php', 3297 - 'PhabricatorUserSearchIndexer' => 'applications/people/search/PhabricatorUserSearchIndexer.php', 3298 3301 'PhabricatorUserSinceField' => 'applications/people/customfield/PhabricatorUserSinceField.php', 3299 3302 'PhabricatorUserStatusField' => 'applications/people/customfield/PhabricatorUserStatusField.php', 3300 3303 'PhabricatorUserTestCase' => 'applications/people/storage/__tests__/PhabricatorUserTestCase.php', ··· 3451 3454 'PholioMockEditController' => 'applications/pholio/controller/PholioMockEditController.php', 3452 3455 'PholioMockEditor' => 'applications/pholio/editor/PholioMockEditor.php', 3453 3456 'PholioMockEmbedView' => 'applications/pholio/view/PholioMockEmbedView.php', 3457 + 'PholioMockFulltextEngine' => 'applications/pholio/search/PholioMockFulltextEngine.php', 3454 3458 'PholioMockHasTaskEdgeType' => 'applications/pholio/edge/PholioMockHasTaskEdgeType.php', 3455 3459 'PholioMockHeraldField' => 'applications/pholio/herald/PholioMockHeraldField.php', 3456 3460 'PholioMockHeraldFieldGroup' => 'applications/pholio/herald/PholioMockHeraldFieldGroup.php', ··· 3466 3470 'PholioRemarkupRule' => 'applications/pholio/remarkup/PholioRemarkupRule.php', 3467 3471 'PholioReplyHandler' => 'applications/pholio/mail/PholioReplyHandler.php', 3468 3472 'PholioSchemaSpec' => 'applications/pholio/storage/PholioSchemaSpec.php', 3469 - 'PholioSearchIndexer' => 'applications/pholio/search/PholioSearchIndexer.php', 3470 3473 'PholioTransaction' => 'applications/pholio/storage/PholioTransaction.php', 3471 3474 'PholioTransactionComment' => 'applications/pholio/storage/PholioTransactionComment.php', 3472 3475 'PholioTransactionQuery' => 'applications/pholio/query/PholioTransactionQuery.php', ··· 3638 3641 'PhrictionDocumentAuthorHeraldField' => 'applications/phriction/herald/PhrictionDocumentAuthorHeraldField.php', 3639 3642 'PhrictionDocumentContentHeraldField' => 'applications/phriction/herald/PhrictionDocumentContentHeraldField.php', 3640 3643 'PhrictionDocumentController' => 'applications/phriction/controller/PhrictionDocumentController.php', 3644 + 'PhrictionDocumentFulltextEngine' => 'applications/phriction/search/PhrictionDocumentFulltextEngine.php', 3641 3645 'PhrictionDocumentHeraldAdapter' => 'applications/phriction/herald/PhrictionDocumentHeraldAdapter.php', 3642 3646 'PhrictionDocumentHeraldField' => 'applications/phriction/herald/PhrictionDocumentHeraldField.php', 3643 3647 'PhrictionDocumentHeraldFieldGroup' => 'applications/phriction/herald/PhrictionDocumentHeraldFieldGroup.php', ··· 3658 3662 'PhrictionReplyHandler' => 'applications/phriction/mail/PhrictionReplyHandler.php', 3659 3663 'PhrictionSchemaSpec' => 'applications/phriction/storage/PhrictionSchemaSpec.php', 3660 3664 'PhrictionSearchEngine' => 'applications/phriction/query/PhrictionSearchEngine.php', 3661 - 'PhrictionSearchIndexer' => 'applications/phriction/search/PhrictionSearchIndexer.php', 3662 3665 'PhrictionTransaction' => 'applications/phriction/storage/PhrictionTransaction.php', 3663 3666 'PhrictionTransactionComment' => 'applications/phriction/storage/PhrictionTransactionComment.php', 3664 3667 'PhrictionTransactionEditor' => 'applications/phriction/editor/PhrictionTransactionEditor.php', ··· 3693 3696 'PonderQuestionCommentController' => 'applications/ponder/controller/PonderQuestionCommentController.php', 3694 3697 'PonderQuestionEditController' => 'applications/ponder/controller/PonderQuestionEditController.php', 3695 3698 'PonderQuestionEditor' => 'applications/ponder/editor/PonderQuestionEditor.php', 3699 + 'PonderQuestionFulltextEngine' => 'applications/ponder/search/PonderQuestionFulltextEngine.php', 3696 3700 'PonderQuestionHistoryController' => 'applications/ponder/controller/PonderQuestionHistoryController.php', 3697 3701 'PonderQuestionListController' => 'applications/ponder/controller/PonderQuestionListController.php', 3698 3702 'PonderQuestionMailReceiver' => 'applications/ponder/mail/PonderQuestionMailReceiver.php', ··· 3708 3712 'PonderQuestionViewController' => 'applications/ponder/controller/PonderQuestionViewController.php', 3709 3713 'PonderRemarkupRule' => 'applications/ponder/remarkup/PonderRemarkupRule.php', 3710 3714 'PonderSchemaSpec' => 'applications/ponder/storage/PonderSchemaSpec.php', 3711 - 'PonderSearchIndexer' => 'applications/ponder/search/PonderSearchIndexer.php', 3712 3715 'PonderVotableInterface' => 'applications/ponder/storage/PonderVotableInterface.php', 3713 3716 'PonderVote' => 'applications/ponder/constants/PonderVote.php', 3714 3717 'PonderVoteEditor' => 'applications/ponder/editor/PonderVoteEditor.php', ··· 4398 4401 'PhabricatorMentionableInterface', 4399 4402 'PhabricatorDestructibleInterface', 4400 4403 'PhabricatorProjectInterface', 4404 + 'PhabricatorFulltextInterface', 4401 4405 ), 4402 4406 'DifferentialRevisionAffectedFilesHeraldField' => 'DifferentialRevisionHeraldField', 4403 4407 'DifferentialRevisionAuthorHeraldField' => 'DifferentialRevisionHeraldField', ··· 4411 4415 'DifferentialRevisionDependsOnRevisionEdgeType' => 'PhabricatorEdgeType', 4412 4416 'DifferentialRevisionDetailView' => 'AphrontView', 4413 4417 'DifferentialRevisionEditController' => 'DifferentialController', 4418 + 'DifferentialRevisionFulltextEngine' => 'PhabricatorFulltextEngine', 4414 4419 'DifferentialRevisionHasCommitEdgeType' => 'PhabricatorEdgeType', 4415 4420 'DifferentialRevisionHasReviewerEdgeType' => 'PhabricatorEdgeType', 4416 4421 'DifferentialRevisionHasTaskEdgeType' => 'PhabricatorEdgeType', ··· 4436 4441 'DifferentialRevisionUpdateHistoryView' => 'AphrontView', 4437 4442 'DifferentialRevisionViewController' => 'DifferentialController', 4438 4443 'DifferentialSchemaSpec' => 'PhabricatorConfigSchemaSpec', 4439 - 'DifferentialSearchIndexer' => 'PhabricatorSearchDocumentIndexer', 4440 4444 'DifferentialSetDiffPropertyConduitAPIMethod' => 'DifferentialConduitAPIMethod', 4441 4445 'DifferentialStoredCustomField' => 'DifferentialCustomField', 4442 4446 'DifferentialSubscribersField' => 'DifferentialCoreCustomField', ··· 4485 4489 'DiffusionCommitDiffContentRemovedHeraldField' => 'DiffusionCommitHeraldField', 4486 4490 'DiffusionCommitDiffEnormousHeraldField' => 'DiffusionCommitHeraldField', 4487 4491 'DiffusionCommitEditController' => 'DiffusionController', 4492 + 'DiffusionCommitFulltextEngine' => 'PhabricatorFulltextEngine', 4488 4493 'DiffusionCommitHasRevisionEdgeType' => 'PhabricatorEdgeType', 4489 4494 'DiffusionCommitHasTaskEdgeType' => 'PhabricatorEdgeType', 4490 4495 'DiffusionCommitHash' => 'Phobject', ··· 4699 4704 'DivinerAtomQuery' => 'PhabricatorCursorPagedPolicyAwareQuery', 4700 4705 'DivinerAtomRef' => 'Phobject', 4701 4706 'DivinerAtomSearchEngine' => 'PhabricatorApplicationSearchEngine', 4702 - 'DivinerAtomSearchIndexer' => 'PhabricatorSearchDocumentIndexer', 4703 4707 'DivinerAtomizeWorkflow' => 'DivinerWorkflow', 4704 4708 'DivinerAtomizer' => 'Phobject', 4705 4709 'DivinerBookController' => 'DivinerController', ··· 4708 4712 'DivinerBookItemView' => 'AphrontTagView', 4709 4713 'DivinerBookPHIDType' => 'PhabricatorPHIDType', 4710 4714 'DivinerBookQuery' => 'PhabricatorCursorPagedPolicyAwareQuery', 4711 - 'DivinerBookSearchIndexer' => 'PhabricatorSearchDocumentIndexer', 4712 4715 'DivinerController' => 'PhabricatorController', 4713 4716 'DivinerDAO' => 'PhabricatorLiskDAO', 4714 4717 'DivinerDefaultEditCapability' => 'PhabricatorPolicyCapability', ··· 4725 4728 'PhabricatorProjectInterface', 4726 4729 'PhabricatorDestructibleInterface', 4727 4730 'PhabricatorApplicationTransactionInterface', 4731 + 'PhabricatorFulltextInterface', 4728 4732 ), 4729 4733 'DivinerLiveBookEditor' => 'PhabricatorApplicationTransactionEditor', 4734 + 'DivinerLiveBookFulltextEngine' => 'PhabricatorFulltextEngine', 4730 4735 'DivinerLiveBookTransaction' => 'PhabricatorApplicationTransaction', 4731 4736 'DivinerLiveBookTransactionQuery' => 'PhabricatorApplicationTransactionQuery', 4732 4737 'DivinerLivePublisher' => 'DivinerPublisher', ··· 4735 4740 'PhabricatorPolicyInterface', 4736 4741 'PhabricatorMarkupInterface', 4737 4742 'PhabricatorDestructibleInterface', 4743 + 'PhabricatorFulltextInterface', 4738 4744 ), 4745 + 'DivinerLiveSymbolFulltextEngine' => 'PhabricatorFulltextEngine', 4739 4746 'DivinerMainController' => 'DivinerController', 4740 4747 'DivinerPHPAtomizer' => 'DivinerAtomizer', 4741 4748 'DivinerParameterTableView' => 'AphrontTagView', ··· 4964 4971 'PhabricatorFlaggableInterface', 4965 4972 'PhabricatorTokenReceiverInterface', 4966 4973 'PhabricatorDestructibleInterface', 4974 + 'PhabricatorFulltextInterface', 4967 4975 ), 4968 4976 'FundInitiativeBackController' => 'FundController', 4969 4977 'FundInitiativeCloseController' => 'FundController', 4970 4978 'FundInitiativeEditController' => 'FundController', 4971 4979 'FundInitiativeEditor' => 'PhabricatorApplicationTransactionEditor', 4972 - 'FundInitiativeIndexer' => 'PhabricatorSearchDocumentIndexer', 4980 + 'FundInitiativeFulltextEngine' => 'PhabricatorFulltextEngine', 4973 4981 'FundInitiativeListController' => 'FundController', 4974 4982 'FundInitiativePHIDType' => 'PhabricatorPHIDType', 4975 4983 'FundInitiativeQuery' => 'PhabricatorCursorPagedPolicyAwareQuery', ··· 5351 5359 'ManiphestReportController' => 'ManiphestController', 5352 5360 'ManiphestSchemaSpec' => 'PhabricatorConfigSchemaSpec', 5353 5361 'ManiphestSearchConduitAPIMethod' => 'PhabricatorSearchEngineAPIMethod', 5354 - 'ManiphestSearchIndexer' => 'PhabricatorSearchDocumentIndexer', 5355 5362 'ManiphestStatusConfigOptionType' => 'PhabricatorConfigJSONOptionType', 5356 5363 'ManiphestStatusEmailCommand' => 'ManiphestEmailCommand', 5357 5364 'ManiphestSubpriorityController' => 'ManiphestController', ··· 5370 5377 'PhabricatorProjectInterface', 5371 5378 'PhabricatorSpacesInterface', 5372 5379 'PhabricatorConduitResultInterface', 5380 + 'PhabricatorFulltextInterface', 5373 5381 ), 5374 5382 'ManiphestTaskAssignHeraldAction' => 'HeraldAction', 5375 5383 'ManiphestTaskAssignOtherHeraldAction' => 'ManiphestTaskAssignHeraldAction', ··· 5384 5392 'ManiphestTaskDetailController' => 'ManiphestController', 5385 5393 'ManiphestTaskEditBulkJobType' => 'PhabricatorWorkerBulkJobType', 5386 5394 'ManiphestTaskEditController' => 'ManiphestController', 5395 + 'ManiphestTaskFulltextEngine' => 'PhabricatorFulltextEngine', 5387 5396 'ManiphestTaskHasCommitEdgeType' => 'PhabricatorEdgeType', 5388 5397 'ManiphestTaskHasMockEdgeType' => 'PhabricatorEdgeType', 5389 5398 'ManiphestTaskHasRevisionEdgeType' => 'PhabricatorEdgeType', ··· 5616 5625 'PhabricatorSubscribableInterface', 5617 5626 'PhabricatorDestructibleInterface', 5618 5627 'PhabricatorSpacesInterface', 5628 + 'PhabricatorFulltextInterface', 5619 5629 ), 5620 5630 'PassphraseCredentialAuthorPolicyRule' => 'PhabricatorPolicyRule', 5621 5631 'PassphraseCredentialConduitController' => 'PassphraseController', ··· 5623 5633 'PassphraseCredentialCreateController' => 'PassphraseController', 5624 5634 'PassphraseCredentialDestroyController' => 'PassphraseController', 5625 5635 'PassphraseCredentialEditController' => 'PassphraseController', 5636 + 'PassphraseCredentialFulltextEngine' => 'PhabricatorFulltextEngine', 5626 5637 'PassphraseCredentialListController' => 'PassphraseController', 5627 5638 'PassphraseCredentialLockController' => 'PassphraseController', 5628 5639 'PassphraseCredentialPHIDType' => 'PhabricatorPHIDType', ··· 5650 5661 'PassphraseSSHPrivateKeyFileCredentialType' => 'PassphraseSSHPrivateKeyCredentialType', 5651 5662 'PassphraseSSHPrivateKeyTextCredentialType' => 'PassphraseSSHPrivateKeyCredentialType', 5652 5663 'PassphraseSchemaSpec' => 'PhabricatorConfigSchemaSpec', 5653 - 'PassphraseSearchIndexer' => 'PhabricatorSearchDocumentIndexer', 5654 5664 'PassphraseSecret' => 'PassphraseDAO', 5655 5665 'PasteConduitAPIMethod' => 'ConduitAPIMethod', 5656 5666 'PasteCreateConduitAPIMethod' => 'PasteConduitAPIMethod', ··· 5971 5981 'PhabricatorMentionableInterface', 5972 5982 'PhabricatorFlaggableInterface', 5973 5983 'PhabricatorSpacesInterface', 5984 + 'PhabricatorFulltextInterface', 5974 5985 ), 5975 5986 'PhabricatorCalendarEventCancelController' => 'PhabricatorCalendarController', 5976 5987 'PhabricatorCalendarEventCommentController' => 'PhabricatorCalendarController', ··· 5978 5989 'PhabricatorCalendarEventEditController' => 'PhabricatorCalendarController', 5979 5990 'PhabricatorCalendarEventEditor' => 'PhabricatorApplicationTransactionEditor', 5980 5991 'PhabricatorCalendarEventEmailCommand' => 'MetaMTAEmailTransactionCommand', 5992 + 'PhabricatorCalendarEventFulltextEngine' => 'PhabricatorFulltextEngine', 5981 5993 'PhabricatorCalendarEventInvitee' => array( 5982 5994 'PhabricatorCalendarDAO', 5983 5995 'PhabricatorPolicyInterface', ··· 5990 6002 'PhabricatorCalendarEventQuery' => 'PhabricatorCursorPagedPolicyAwareQuery', 5991 6003 'PhabricatorCalendarEventRSVPEmailCommand' => 'PhabricatorCalendarEventEmailCommand', 5992 6004 'PhabricatorCalendarEventSearchEngine' => 'PhabricatorApplicationSearchEngine', 5993 - 'PhabricatorCalendarEventSearchIndexer' => 'PhabricatorSearchDocumentIndexer', 5994 6005 'PhabricatorCalendarEventTransaction' => 'PhabricatorApplicationTransaction', 5995 6006 'PhabricatorCalendarEventTransactionComment' => 'PhabricatorApplicationTransactionComment', 5996 6007 'PhabricatorCalendarEventTransactionQuery' => 'PhabricatorApplicationTransactionQuery', ··· 6552 6563 'PhabricatorFlaggableInterface' => 'PhabricatorPHIDInterface', 6553 6564 'PhabricatorFlagsApplication' => 'PhabricatorApplication', 6554 6565 'PhabricatorFlagsUIEventListener' => 'PhabricatorEventListener', 6566 + 'PhabricatorFulltextEngine' => 'Phobject', 6555 6567 'PhabricatorFulltextEngineExtension' => 'Phobject', 6556 6568 'PhabricatorFulltextEngineExtensionModule' => 'PhabricatorConfigModule', 6569 + 'PhabricatorFulltextIndexEngineExtension' => 'PhabricatorIndexEngineExtension', 6557 6570 'PhabricatorFundApplication' => 'PhabricatorApplication', 6558 6571 'PhabricatorGDSetupCheck' => 'PhabricatorSetupCheck', 6559 6572 'PhabricatorGarbageCollector' => 'Phobject', ··· 6637 6650 'PhabricatorLipsumManagementWorkflow' => 'PhabricatorManagementWorkflow', 6638 6651 'PhabricatorLipsumMondrianArtist' => 'PhabricatorLipsumArtist', 6639 6652 'PhabricatorLiskDAO' => 'LiskDAO', 6653 + 'PhabricatorLiskFulltextEngineExtension' => 'PhabricatorFulltextEngineExtension', 6640 6654 'PhabricatorLiskSearchEngineExtension' => 'PhabricatorSearchEngineExtension', 6641 6655 'PhabricatorLiskSerializer' => 'Phobject', 6642 6656 'PhabricatorListFilterUIExample' => 'PhabricatorUIExample', ··· 7100 7114 'PhabricatorSubscribableInterface', 7101 7115 'PhabricatorCustomFieldInterface', 7102 7116 'PhabricatorDestructibleInterface', 7117 + 'PhabricatorFulltextInterface', 7103 7118 ), 7104 7119 'PhabricatorProjectAddHeraldAction' => 'PhabricatorProjectHeraldAction', 7105 7120 'PhabricatorProjectApplication' => 'PhabricatorApplication', ··· 7144 7159 'PhabricatorProjectEditPictureController' => 'PhabricatorProjectController', 7145 7160 'PhabricatorProjectEditorTestCase' => 'PhabricatorTestCase', 7146 7161 'PhabricatorProjectFeedController' => 'PhabricatorProjectController', 7162 + 'PhabricatorProjectFulltextEngine' => 'PhabricatorFulltextEngine', 7147 7163 'PhabricatorProjectHeraldAction' => 'HeraldAction', 7148 7164 'PhabricatorProjectIconSet' => 'PhabricatorIconSet', 7149 7165 'PhabricatorProjectListController' => 'PhabricatorProjectController', ··· 7171 7187 'PhabricatorProjectSchemaSpec' => 'PhabricatorConfigSchemaSpec', 7172 7188 'PhabricatorProjectSearchEngine' => 'PhabricatorApplicationSearchEngine', 7173 7189 'PhabricatorProjectSearchField' => 'PhabricatorSearchTokenizerField', 7174 - 'PhabricatorProjectSearchIndexer' => 'PhabricatorSearchDocumentIndexer', 7175 7190 'PhabricatorProjectSlug' => 'PhabricatorProjectDAO', 7176 7191 'PhabricatorProjectStandardCustomField' => array( 7177 7192 'PhabricatorProjectCustomField', ··· 7245 7260 'HarbormasterBuildableInterface', 7246 7261 'PhabricatorCustomFieldInterface', 7247 7262 'PhabricatorApplicationTransactionInterface', 7263 + 'PhabricatorFulltextInterface', 7248 7264 ), 7249 7265 'PhabricatorRepositoryCommitChangeParserWorker' => 'PhabricatorRepositoryCommitParserWorker', 7250 7266 'PhabricatorRepositoryCommitData' => 'PhabricatorRepositoryDAO', ··· 7254 7270 'PhabricatorRepositoryCommitPHIDType' => 'PhabricatorPHIDType', 7255 7271 'PhabricatorRepositoryCommitParserWorker' => 'PhabricatorWorker', 7256 7272 'PhabricatorRepositoryCommitRef' => 'Phobject', 7257 - 'PhabricatorRepositoryCommitSearchIndexer' => 'PhabricatorSearchDocumentIndexer', 7258 7273 'PhabricatorRepositoryConfigOptions' => 'PhabricatorApplicationConfigOptions', 7259 7274 'PhabricatorRepositoryDAO' => 'PhabricatorLiskDAO', 7260 7275 'PhabricatorRepositoryDiscoveryEngine' => 'PhabricatorRepositoryEngine', ··· 7380 7395 'PhabricatorSearchDocument' => 'PhabricatorSearchDAO', 7381 7396 'PhabricatorSearchDocumentField' => 'PhabricatorSearchDAO', 7382 7397 'PhabricatorSearchDocumentFieldType' => 'Phobject', 7383 - 'PhabricatorSearchDocumentIndexer' => 'Phobject', 7384 7398 'PhabricatorSearchDocumentQuery' => 'PhabricatorCursorPagedPolicyAwareQuery', 7385 7399 'PhabricatorSearchDocumentRelationship' => 'PhabricatorSearchDAO', 7386 7400 'PhabricatorSearchDocumentTypeDatasource' => 'PhabricatorTypeaheadDatasource', ··· 7656 7670 'PhabricatorSSHPublicKeyInterface', 7657 7671 'PhabricatorFlaggableInterface', 7658 7672 'PhabricatorApplicationTransactionInterface', 7673 + 'PhabricatorFulltextInterface', 7659 7674 ), 7660 7675 'PhabricatorUserBlurbField' => 'PhabricatorUserCustomField', 7661 7676 'PhabricatorUserConfigOptions' => 'PhabricatorApplicationConfigOptions', ··· 7672 7687 'PhabricatorUserEditorTestCase' => 'PhabricatorTestCase', 7673 7688 'PhabricatorUserEmail' => 'PhabricatorUserDAO', 7674 7689 'PhabricatorUserEmailTestCase' => 'PhabricatorTestCase', 7690 + 'PhabricatorUserFulltextEngine' => 'PhabricatorFulltextEngine', 7675 7691 'PhabricatorUserLog' => array( 7676 7692 'PhabricatorUserDAO', 7677 7693 'PhabricatorPolicyInterface', ··· 7684 7700 'PhabricatorUserRealNameField' => 'PhabricatorUserCustomField', 7685 7701 'PhabricatorUserRolesField' => 'PhabricatorUserCustomField', 7686 7702 'PhabricatorUserSchemaSpec' => 'PhabricatorConfigSchemaSpec', 7687 - 'PhabricatorUserSearchIndexer' => 'PhabricatorSearchDocumentIndexer', 7688 7703 'PhabricatorUserSinceField' => 'PhabricatorUserCustomField', 7689 7704 'PhabricatorUserStatusField' => 'PhabricatorUserCustomField', 7690 7705 'PhabricatorUserTestCase' => 'PhabricatorTestCase', ··· 7883 7898 'PhabricatorDestructibleInterface', 7884 7899 'PhabricatorSpacesInterface', 7885 7900 'PhabricatorMentionableInterface', 7901 + 'PhabricatorFulltextInterface', 7886 7902 ), 7887 7903 'PholioMockArchiveController' => 'PholioController', 7888 7904 'PholioMockAuthorHeraldField' => 'PholioMockHeraldField', ··· 7891 7907 'PholioMockEditController' => 'PholioController', 7892 7908 'PholioMockEditor' => 'PhabricatorApplicationTransactionEditor', 7893 7909 'PholioMockEmbedView' => 'AphrontView', 7910 + 'PholioMockFulltextEngine' => 'PhabricatorFulltextEngine', 7894 7911 'PholioMockHasTaskEdgeType' => 'PhabricatorEdgeType', 7895 7912 'PholioMockHeraldField' => 'HeraldField', 7896 7913 'PholioMockHeraldFieldGroup' => 'HeraldFieldGroup', ··· 7906 7923 'PholioRemarkupRule' => 'PhabricatorObjectRemarkupRule', 7907 7924 'PholioReplyHandler' => 'PhabricatorApplicationTransactionReplyHandler', 7908 7925 'PholioSchemaSpec' => 'PhabricatorConfigSchemaSpec', 7909 - 'PholioSearchIndexer' => 'PhabricatorSearchDocumentIndexer', 7910 7926 'PholioTransaction' => 'PhabricatorApplicationTransaction', 7911 7927 'PholioTransactionComment' => 'PhabricatorApplicationTransactionComment', 7912 7928 'PholioTransactionQuery' => 'PhabricatorApplicationTransactionQuery', ··· 8129 8145 'PhabricatorTokenReceiverInterface', 8130 8146 'PhabricatorDestructibleInterface', 8131 8147 'PhabricatorApplicationTransactionInterface', 8148 + 'PhabricatorFulltextInterface', 8132 8149 ), 8133 8150 'PhrictionDocumentAuthorHeraldField' => 'PhrictionDocumentHeraldField', 8134 8151 'PhrictionDocumentContentHeraldField' => 'PhrictionDocumentHeraldField', 8135 8152 'PhrictionDocumentController' => 'PhrictionController', 8153 + 'PhrictionDocumentFulltextEngine' => 'PhabricatorFulltextEngine', 8136 8154 'PhrictionDocumentHeraldAdapter' => 'HeraldAdapter', 8137 8155 'PhrictionDocumentHeraldField' => 'HeraldField', 8138 8156 'PhrictionDocumentHeraldFieldGroup' => 'HeraldFieldGroup', ··· 8153 8171 'PhrictionReplyHandler' => 'PhabricatorApplicationTransactionReplyHandler', 8154 8172 'PhrictionSchemaSpec' => 'PhabricatorConfigSchemaSpec', 8155 8173 'PhrictionSearchEngine' => 'PhabricatorApplicationSearchEngine', 8156 - 'PhrictionSearchIndexer' => 'PhabricatorSearchDocumentIndexer', 8157 8174 'PhrictionTransaction' => 'PhabricatorApplicationTransaction', 8158 8175 'PhrictionTransactionComment' => 'PhabricatorApplicationTransactionComment', 8159 8176 'PhrictionTransactionEditor' => 'PhabricatorApplicationTransactionEditor', ··· 8204 8221 'PhabricatorProjectInterface', 8205 8222 'PhabricatorDestructibleInterface', 8206 8223 'PhabricatorSpacesInterface', 8224 + 'PhabricatorFulltextInterface', 8207 8225 ), 8208 8226 'PonderQuestionCommentController' => 'PonderController', 8209 8227 'PonderQuestionEditController' => 'PonderController', 8210 8228 'PonderQuestionEditor' => 'PonderEditor', 8229 + 'PonderQuestionFulltextEngine' => 'PhabricatorFulltextEngine', 8211 8230 'PonderQuestionHistoryController' => 'PonderController', 8212 8231 'PonderQuestionListController' => 'PonderController', 8213 8232 'PonderQuestionMailReceiver' => 'PhabricatorObjectMailReceiver', ··· 8223 8242 'PonderQuestionViewController' => 'PonderController', 8224 8243 'PonderRemarkupRule' => 'PhabricatorObjectRemarkupRule', 8225 8244 'PonderSchemaSpec' => 'PhabricatorConfigSchemaSpec', 8226 - 'PonderSearchIndexer' => 'PhabricatorSearchDocumentIndexer', 8227 8245 'PonderVote' => 'PonderConstants', 8228 8246 'PonderVoteEditor' => 'PhabricatorEditor', 8229 8247 'PonderVotingUserHasAnswerEdgeType' => 'PhabricatorEdgeType',
+39
src/applications/calendar/search/PhabricatorCalendarEventFulltextEngine.php
··· 1 + <?php 2 + 3 + final class PhabricatorCalendarEventFulltextEngine 4 + extends PhabricatorFulltextEngine { 5 + 6 + protected function buildAbstractDocument( 7 + PhabricatorSearchAbstractDocument $document, 8 + $object) { 9 + 10 + $event = $object; 11 + 12 + $document->setDocumentTitle($event->getName()); 13 + 14 + $document->addField( 15 + PhabricatorSearchDocumentFieldType::FIELD_BODY, 16 + $event->getDescription()); 17 + 18 + $document->addRelationship( 19 + PhabricatorSearchRelationship::RELATIONSHIP_AUTHOR, 20 + $event->getUserPHID(), 21 + PhabricatorPeopleUserPHIDType::TYPECONST, 22 + $event->getDateCreated()); 23 + 24 + $document->addRelationship( 25 + PhabricatorSearchRelationship::RELATIONSHIP_OWNER, 26 + $event->getUserPHID(), 27 + PhabricatorPeopleUserPHIDType::TYPECONST, 28 + $event->getDateCreated()); 29 + 30 + $document->addRelationship( 31 + $event->getIsCancelled() 32 + ? PhabricatorSearchRelationship::RELATIONSHIP_CLOSED 33 + : PhabricatorSearchRelationship::RELATIONSHIP_OPEN, 34 + $event->getPHID(), 35 + PhabricatorCalendarEventPHIDType::TYPECONST, 36 + PhabricatorTime::getNow()); 37 + } 38 + 39 + }
-47
src/applications/calendar/search/PhabricatorCalendarEventSearchIndexer.php
··· 1 - <?php 2 - 3 - final class PhabricatorCalendarEventSearchIndexer 4 - extends PhabricatorSearchDocumentIndexer { 5 - 6 - public function getIndexableObject() { 7 - return new PhabricatorCalendarEvent(); 8 - } 9 - 10 - protected function buildAbstractDocumentByPHID($phid) { 11 - $event = $this->loadDocumentByPHID($phid); 12 - 13 - $doc = new PhabricatorSearchAbstractDocument(); 14 - $doc->setPHID($event->getPHID()); 15 - $doc->setDocumentType(PhabricatorCalendarEventPHIDType::TYPECONST); 16 - $doc->setDocumentTitle($event->getName()); 17 - $doc->setDocumentCreated($event->getDateCreated()); 18 - $doc->setDocumentModified($event->getDateModified()); 19 - 20 - $doc->addField( 21 - PhabricatorSearchDocumentFieldType::FIELD_BODY, 22 - $event->getDescription()); 23 - 24 - $doc->addRelationship( 25 - PhabricatorSearchRelationship::RELATIONSHIP_AUTHOR, 26 - $event->getUserPHID(), 27 - PhabricatorPeopleUserPHIDType::TYPECONST, 28 - $event->getDateCreated()); 29 - 30 - $doc->addRelationship( 31 - PhabricatorSearchRelationship::RELATIONSHIP_OWNER, 32 - $event->getUserPHID(), 33 - PhabricatorPeopleUserPHIDType::TYPECONST, 34 - $event->getDateCreated()); 35 - 36 - $doc->addRelationship( 37 - $event->getIsCancelled() 38 - ? PhabricatorSearchRelationship::RELATIONSHIP_CLOSED 39 - : PhabricatorSearchRelationship::RELATIONSHIP_OPEN, 40 - $event->getPHID(), 41 - PhabricatorCalendarEventPHIDType::TYPECONST, 42 - time()); 43 - 44 - return $doc; 45 - } 46 - 47 - }
+11 -1
src/applications/calendar/storage/PhabricatorCalendarEvent.php
··· 10 10 PhabricatorDestructibleInterface, 11 11 PhabricatorMentionableInterface, 12 12 PhabricatorFlaggableInterface, 13 - PhabricatorSpacesInterface { 13 + PhabricatorSpacesInterface, 14 + PhabricatorFulltextInterface { 14 15 15 16 protected $name; 16 17 protected $userPHID; ··· 562 563 public function getSpacePHID() { 563 564 return $this->spacePHID; 564 565 } 566 + 567 + 568 + /* -( PhabricatorFulltextInterface )--------------------------------------- */ 569 + 570 + 571 + public function newFulltextEngine() { 572 + return new PhabricatorCalendarEventFulltextEngine(); 573 + } 574 + 565 575 }
+64
src/applications/differential/search/DifferentialRevisionFulltextEngine.php
··· 1 + <?php 2 + 3 + final class DifferentialRevisionFulltextEngine 4 + extends PhabricatorFulltextEngine { 5 + 6 + protected function buildAbstractDocument( 7 + PhabricatorSearchAbstractDocument $document, 8 + $object) { 9 + 10 + $revision = id(new DifferentialRevisionQuery()) 11 + ->setViewer($this->getViewer()) 12 + ->withPHIDs(array($object->getPHID())) 13 + ->needReviewerStatus(true) 14 + ->executeOne(); 15 + 16 + // TODO: This isn't very clean, but custom fields currently rely on it. 17 + $object->attachReviewerStatus($revision->getReviewerStatus()); 18 + 19 + $document->setDocumentTitle($revision->getTitle()); 20 + 21 + $document->addRelationship( 22 + PhabricatorSearchRelationship::RELATIONSHIP_AUTHOR, 23 + $revision->getAuthorPHID(), 24 + PhabricatorPeopleUserPHIDType::TYPECONST, 25 + $revision->getDateCreated()); 26 + 27 + $document->addRelationship( 28 + $revision->isClosed() 29 + ? PhabricatorSearchRelationship::RELATIONSHIP_CLOSED 30 + : PhabricatorSearchRelationship::RELATIONSHIP_OPEN, 31 + $revision->getPHID(), 32 + DifferentialRevisionPHIDType::TYPECONST, 33 + PhabricatorTime::getNow()); 34 + 35 + // If a revision needs review, the owners are the reviewers. Otherwise, the 36 + // owner is the author (e.g., accepted, rejected, closed). 37 + $status_review = ArcanistDifferentialRevisionStatus::NEEDS_REVIEW; 38 + if ($revision->getStatus() == $status_review) { 39 + $reviewers = $revision->getReviewerStatus(); 40 + $reviewers = mpull($reviewers, 'getReviewerPHID', 'getReviewerPHID'); 41 + if ($reviewers) { 42 + foreach ($reviewers as $phid) { 43 + $document->addRelationship( 44 + PhabricatorSearchRelationship::RELATIONSHIP_OWNER, 45 + $phid, 46 + PhabricatorPeopleUserPHIDType::TYPECONST, 47 + $revision->getDateModified()); // Bogus timestamp. 48 + } 49 + } else { 50 + $document->addRelationship( 51 + PhabricatorSearchRelationship::RELATIONSHIP_UNOWNED, 52 + $revision->getPHID(), 53 + PhabricatorPeopleUserPHIDType::TYPECONST, 54 + $revision->getDateModified()); // Bogus timestamp. 55 + } 56 + } else { 57 + $document->addRelationship( 58 + PhabricatorSearchRelationship::RELATIONSHIP_OWNER, 59 + $revision->getAuthorPHID(), 60 + PhabricatorPHIDConstants::PHID_TYPE_VOID, 61 + $revision->getDateCreated()); 62 + } 63 + } 64 + }
-76
src/applications/differential/search/DifferentialSearchIndexer.php
··· 1 - <?php 2 - 3 - final class DifferentialSearchIndexer 4 - extends PhabricatorSearchDocumentIndexer { 5 - 6 - public function getIndexableObject() { 7 - return new DifferentialRevision(); 8 - } 9 - 10 - protected function loadDocumentByPHID($phid) { 11 - $object = id(new DifferentialRevisionQuery()) 12 - ->setViewer($this->getViewer()) 13 - ->withPHIDs(array($phid)) 14 - ->needReviewerStatus(true) 15 - ->executeOne(); 16 - if (!$object) { 17 - throw new Exception(pht("Unable to load object by PHID '%s'!", $phid)); 18 - } 19 - return $object; 20 - } 21 - 22 - protected function buildAbstractDocumentByPHID($phid) { 23 - $rev = $this->loadDocumentByPHID($phid); 24 - 25 - $doc = new PhabricatorSearchAbstractDocument(); 26 - $doc->setPHID($rev->getPHID()); 27 - $doc->setDocumentType(DifferentialRevisionPHIDType::TYPECONST); 28 - $doc->setDocumentTitle($rev->getTitle()); 29 - $doc->setDocumentCreated($rev->getDateCreated()); 30 - $doc->setDocumentModified($rev->getDateModified()); 31 - 32 - $doc->addRelationship( 33 - PhabricatorSearchRelationship::RELATIONSHIP_AUTHOR, 34 - $rev->getAuthorPHID(), 35 - PhabricatorPeopleUserPHIDType::TYPECONST, 36 - $rev->getDateCreated()); 37 - 38 - $doc->addRelationship( 39 - $rev->isClosed() 40 - ? PhabricatorSearchRelationship::RELATIONSHIP_CLOSED 41 - : PhabricatorSearchRelationship::RELATIONSHIP_OPEN, 42 - $rev->getPHID(), 43 - DifferentialRevisionPHIDType::TYPECONST, 44 - time()); 45 - 46 - // If a revision needs review, the owners are the reviewers. Otherwise, the 47 - // owner is the author (e.g., accepted, rejected, closed). 48 - if ($rev->getStatus() == ArcanistDifferentialRevisionStatus::NEEDS_REVIEW) { 49 - $reviewers = $rev->getReviewerStatus(); 50 - $reviewers = mpull($reviewers, 'getReviewerPHID', 'getReviewerPHID'); 51 - if ($reviewers) { 52 - foreach ($reviewers as $phid) { 53 - $doc->addRelationship( 54 - PhabricatorSearchRelationship::RELATIONSHIP_OWNER, 55 - $phid, 56 - PhabricatorPeopleUserPHIDType::TYPECONST, 57 - $rev->getDateModified()); // Bogus timestamp. 58 - } 59 - } else { 60 - $doc->addRelationship( 61 - PhabricatorSearchRelationship::RELATIONSHIP_UNOWNED, 62 - $rev->getPHID(), 63 - PhabricatorPeopleUserPHIDType::TYPECONST, 64 - $rev->getDateModified()); // Bogus timestamp. 65 - } 66 - } else { 67 - $doc->addRelationship( 68 - PhabricatorSearchRelationship::RELATIONSHIP_OWNER, 69 - $rev->getAuthorPHID(), 70 - PhabricatorPHIDConstants::PHID_TYPE_VOID, 71 - $rev->getDateCreated()); 72 - } 73 - 74 - return $doc; 75 - } 76 - }
+11 -1
src/applications/differential/storage/DifferentialRevision.php
··· 13 13 PhabricatorApplicationTransactionInterface, 14 14 PhabricatorMentionableInterface, 15 15 PhabricatorDestructibleInterface, 16 - PhabricatorProjectInterface { 16 + PhabricatorProjectInterface, 17 + PhabricatorFulltextInterface { 17 18 18 19 protected $title = ''; 19 20 protected $originalTitle; ··· 628 629 $this->delete(); 629 630 $this->saveTransaction(); 630 631 } 632 + 633 + 634 + /* -( PhabricatorFulltextInterface )--------------------------------------- */ 635 + 636 + 637 + public function newFulltextEngine() { 638 + return new DifferentialRevisionFulltextEngine(); 639 + } 640 + 631 641 632 642 }
+11 -17
src/applications/diviner/search/DivinerAtomSearchIndexer.php src/applications/diviner/search/DivinerLiveSymbolFulltextEngine.php
··· 1 1 <?php 2 2 3 - final class DivinerAtomSearchIndexer extends PhabricatorSearchDocumentIndexer { 3 + final class DivinerLiveSymbolFulltextEngine 4 + extends PhabricatorFulltextEngine { 4 5 5 - public function getIndexableObject() { 6 - return new DivinerLiveSymbol(); 7 - } 6 + protected function buildAbstractDocument( 7 + PhabricatorSearchAbstractDocument $document, 8 + $object) { 8 9 9 - protected function buildAbstractDocumentByPHID($phid) { 10 - $atom = $this->loadDocumentByPHID($phid); 10 + $atom = $object; 11 11 $book = $atom->getBook(); 12 12 13 - if (!$atom->getIsDocumentable()) { 14 - return null; 15 - } 16 - 17 - $doc = $this->newDocument($phid) 13 + $document 18 14 ->setDocumentTitle($atom->getTitle()) 19 15 ->setDocumentCreated($book->getDateCreated()) 20 16 ->setDocumentModified($book->getDateModified()); 21 17 22 - $doc->addField( 18 + $document->addField( 23 19 PhabricatorSearchDocumentFieldType::FIELD_BODY, 24 20 $atom->getSummary()); 25 21 26 - $doc->addRelationship( 22 + $document->addRelationship( 27 23 PhabricatorSearchRelationship::RELATIONSHIP_BOOK, 28 24 $atom->getBookPHID(), 29 25 DivinerBookPHIDType::TYPECONST, 30 26 PhabricatorTime::getNow()); 31 27 32 - $doc->addRelationship( 28 + $document->addRelationship( 33 29 PhabricatorSearchRelationship::RELATIONSHIP_REPOSITORY, 34 30 $atom->getRepositoryPHID(), 35 31 PhabricatorRepositoryRepositoryPHIDType::TYPECONST, 36 32 PhabricatorTime::getNow()); 37 33 38 - $doc->addRelationship( 34 + $document->addRelationship( 39 35 $atom->getGraphHash() 40 36 ? PhabricatorSearchRelationship::RELATIONSHIP_CLOSED 41 37 : PhabricatorSearchRelationship::RELATIONSHIP_OPEN, 42 38 $atom->getBookPHID(), 43 39 DivinerBookPHIDType::TYPECONST, 44 40 PhabricatorTime::getNow()); 45 - 46 - return $doc; 47 41 } 48 42 49 43 }
-31
src/applications/diviner/search/DivinerBookSearchIndexer.php
··· 1 - <?php 2 - 3 - final class DivinerBookSearchIndexer extends PhabricatorSearchDocumentIndexer { 4 - 5 - public function getIndexableObject() { 6 - return new DivinerLiveBook(); 7 - } 8 - 9 - protected function buildAbstractDocumentByPHID($phid) { 10 - $book = $this->loadDocumentByPHID($phid); 11 - 12 - $doc = $this->newDocument($phid) 13 - ->setDocumentTitle($book->getTitle()) 14 - ->setDocumentCreated($book->getDateCreated()) 15 - ->setDocumentModified($book->getDateModified()); 16 - 17 - $doc->addField( 18 - PhabricatorSearchDocumentFieldType::FIELD_BODY, 19 - $book->getPreface()); 20 - 21 - $doc->addRelationship( 22 - PhabricatorSearchRelationship::RELATIONSHIP_REPOSITORY, 23 - $book->getRepositoryPHID(), 24 - PhabricatorRepositoryRepositoryPHIDType::TYPECONST, 25 - $book->getDateCreated()); 26 - 27 - return $doc; 28 - } 29 - 30 - 31 - }
+26
src/applications/diviner/search/DivinerLiveBookFulltextEngine.php
··· 1 + <?php 2 + 3 + final class DivinerLiveBookFulltextEngine 4 + extends PhabricatorFulltextEngine { 5 + 6 + protected function buildAbstractDocument( 7 + PhabricatorSearchAbstractDocument $document, 8 + $object) { 9 + 10 + $book = $object; 11 + 12 + $document->setDocumentTitle($book->getTitle()); 13 + 14 + $document->addField( 15 + PhabricatorSearchDocumentFieldType::FIELD_BODY, 16 + $book->getPreface()); 17 + 18 + $document->addRelationship( 19 + PhabricatorSearchRelationship::RELATIONSHIP_REPOSITORY, 20 + $book->getRepositoryPHID(), 21 + PhabricatorRepositoryRepositoryPHIDType::TYPECONST, 22 + $book->getDateCreated()); 23 + } 24 + 25 + 26 + }
+10 -1
src/applications/diviner/storage/DivinerLiveBook.php
··· 5 5 PhabricatorPolicyInterface, 6 6 PhabricatorProjectInterface, 7 7 PhabricatorDestructibleInterface, 8 - PhabricatorApplicationTransactionInterface { 8 + PhabricatorApplicationTransactionInterface, 9 + PhabricatorFulltextInterface { 9 10 10 11 protected $name; 11 12 protected $repositoryPHID; ··· 160 161 161 162 return $timeline; 162 163 } 164 + 165 + /* -( PhabricatorFulltextInterface )--------------------------------------- */ 166 + 167 + 168 + public function newFulltextEngine() { 169 + return new DivinerLiveBookFulltextEngine(); 170 + } 171 + 163 172 164 173 }
+14 -1
src/applications/diviner/storage/DivinerLiveSymbol.php
··· 4 4 implements 5 5 PhabricatorPolicyInterface, 6 6 PhabricatorMarkupInterface, 7 - PhabricatorDestructibleInterface { 7 + PhabricatorDestructibleInterface, 8 + PhabricatorFulltextInterface { 8 9 9 10 protected $bookPHID; 10 11 protected $repositoryPHID; ··· 278 279 279 280 $this->delete(); 280 281 $this->saveTransaction(); 282 + } 283 + 284 + 285 + /* -( PhabricatorFulltextInterface )--------------------------------------- */ 286 + 287 + 288 + public function newFulltextEngine() { 289 + if (!$this->getIsDocumentable()) { 290 + return null; 291 + } 292 + 293 + return new DivinerLiveSymbolFulltextEngine(); 281 294 } 282 295 283 296 }
+34
src/applications/fund/search/FundInitiativeFulltextEngine.php
··· 1 + <?php 2 + 3 + final class FundInitiativeFulltextEngine 4 + extends PhabricatorFulltextEngine { 5 + 6 + protected function buildAbstractDocument( 7 + PhabricatorSearchAbstractDocument $document, 8 + $object) { 9 + 10 + $initiative = $object; 11 + 12 + $document->setDocumentTitle($initiative->getName()); 13 + 14 + $document->addRelationship( 15 + PhabricatorSearchRelationship::RELATIONSHIP_AUTHOR, 16 + $initiative->getOwnerPHID(), 17 + PhabricatorPeopleUserPHIDType::TYPECONST, 18 + $initiative->getDateCreated()); 19 + 20 + $document->addRelationship( 21 + PhabricatorSearchRelationship::RELATIONSHIP_OWNER, 22 + $initiative->getOwnerPHID(), 23 + PhabricatorPeopleUserPHIDType::TYPECONST, 24 + $initiative->getDateCreated()); 25 + 26 + $document->addRelationship( 27 + $initiative->isClosed() 28 + ? PhabricatorSearchRelationship::RELATIONSHIP_CLOSED 29 + : PhabricatorSearchRelationship::RELATIONSHIP_OPEN, 30 + $initiative->getPHID(), 31 + FundInitiativePHIDType::TYPECONST, 32 + PhabricatorTime::getNow()); 33 + } 34 + }
-56
src/applications/fund/search/FundInitiativeIndexer.php
··· 1 - <?php 2 - 3 - final class FundInitiativeIndexer 4 - extends PhabricatorSearchDocumentIndexer { 5 - 6 - public function getIndexableObject() { 7 - return new FundInitiative(); 8 - } 9 - 10 - protected function loadDocumentByPHID($phid) { 11 - $object = id(new FundInitiativeQuery()) 12 - ->setViewer($this->getViewer()) 13 - ->withPHIDs(array($phid)) 14 - ->executeOne(); 15 - if (!$object) { 16 - throw new Exception( 17 - pht( 18 - "Unable to load object by PHID '%s'!", 19 - $phid)); 20 - } 21 - return $object; 22 - } 23 - 24 - protected function buildAbstractDocumentByPHID($phid) { 25 - $initiative = $this->loadDocumentByPHID($phid); 26 - 27 - $doc = id(new PhabricatorSearchAbstractDocument()) 28 - ->setPHID($initiative->getPHID()) 29 - ->setDocumentType(FundInitiativePHIDType::TYPECONST) 30 - ->setDocumentTitle($initiative->getName()) 31 - ->setDocumentCreated($initiative->getDateCreated()) 32 - ->setDocumentModified($initiative->getDateModified()); 33 - 34 - $doc->addRelationship( 35 - PhabricatorSearchRelationship::RELATIONSHIP_AUTHOR, 36 - $initiative->getOwnerPHID(), 37 - PhabricatorPeopleUserPHIDType::TYPECONST, 38 - $initiative->getDateCreated()); 39 - 40 - $doc->addRelationship( 41 - PhabricatorSearchRelationship::RELATIONSHIP_OWNER, 42 - $initiative->getOwnerPHID(), 43 - PhabricatorPeopleUserPHIDType::TYPECONST, 44 - $initiative->getDateCreated()); 45 - 46 - $doc->addRelationship( 47 - $initiative->isClosed() 48 - ? PhabricatorSearchRelationship::RELATIONSHIP_CLOSED 49 - : PhabricatorSearchRelationship::RELATIONSHIP_OPEN, 50 - $initiative->getPHID(), 51 - FundInitiativePHIDType::TYPECONST, 52 - time()); 53 - 54 - return $doc; 55 - } 56 - }
+10 -1
src/applications/fund/storage/FundInitiative.php
··· 9 9 PhabricatorMentionableInterface, 10 10 PhabricatorFlaggableInterface, 11 11 PhabricatorTokenReceiverInterface, 12 - PhabricatorDestructibleInterface { 12 + PhabricatorDestructibleInterface, 13 + PhabricatorFulltextInterface { 13 14 14 15 protected $name; 15 16 protected $ownerPHID; ··· 205 206 $this->openTransaction(); 206 207 $this->delete(); 207 208 $this->saveTransaction(); 209 + } 210 + 211 + 212 + /* -( PhabricatorFulltextInterface )--------------------------------------- */ 213 + 214 + 215 + public function newFulltextEngine() { 216 + return new FundInitiativeFulltextEngine(); 208 217 } 209 218 210 219 }
-55
src/applications/maniphest/search/ManiphestSearchIndexer.php
··· 1 - <?php 2 - 3 - final class ManiphestSearchIndexer extends PhabricatorSearchDocumentIndexer { 4 - 5 - public function getIndexableObject() { 6 - return new ManiphestTask(); 7 - } 8 - 9 - protected function buildAbstractDocumentByPHID($phid) { 10 - $task = $this->loadDocumentByPHID($phid); 11 - 12 - $doc = new PhabricatorSearchAbstractDocument(); 13 - $doc->setPHID($task->getPHID()); 14 - $doc->setDocumentType(ManiphestTaskPHIDType::TYPECONST); 15 - $doc->setDocumentTitle($task->getTitle()); 16 - $doc->setDocumentCreated($task->getDateCreated()); 17 - $doc->setDocumentModified($task->getDateModified()); 18 - 19 - $doc->addField( 20 - PhabricatorSearchDocumentFieldType::FIELD_BODY, 21 - $task->getDescription()); 22 - 23 - $doc->addRelationship( 24 - PhabricatorSearchRelationship::RELATIONSHIP_AUTHOR, 25 - $task->getAuthorPHID(), 26 - PhabricatorPeopleUserPHIDType::TYPECONST, 27 - $task->getDateCreated()); 28 - 29 - $doc->addRelationship( 30 - $task->isClosed() 31 - ? PhabricatorSearchRelationship::RELATIONSHIP_CLOSED 32 - : PhabricatorSearchRelationship::RELATIONSHIP_OPEN, 33 - $task->getPHID(), 34 - ManiphestTaskPHIDType::TYPECONST, 35 - time()); 36 - 37 - $owner = $task->getOwnerPHID(); 38 - if ($owner) { 39 - $doc->addRelationship( 40 - PhabricatorSearchRelationship::RELATIONSHIP_OWNER, 41 - $owner, 42 - PhabricatorPeopleUserPHIDType::TYPECONST, 43 - time()); 44 - } else { 45 - $doc->addRelationship( 46 - PhabricatorSearchRelationship::RELATIONSHIP_UNOWNED, 47 - $task->getPHID(), 48 - PhabricatorPHIDConstants::PHID_TYPE_VOID, 49 - $task->getDateCreated()); 50 - } 51 - 52 - return $doc; 53 - } 54 - 55 - }
+48
src/applications/maniphest/search/ManiphestTaskFulltextEngine.php
··· 1 + <?php 2 + 3 + final class ManiphestTaskFulltextEngine 4 + extends PhabricatorFulltextEngine { 5 + 6 + protected function buildAbstractDocument( 7 + PhabricatorSearchAbstractDocument $document, 8 + $object) { 9 + 10 + $task = $object; 11 + 12 + $document->setDocumentTitle($task->getTitle()); 13 + 14 + $document->addField( 15 + PhabricatorSearchDocumentFieldType::FIELD_BODY, 16 + $task->getDescription()); 17 + 18 + $document->addRelationship( 19 + PhabricatorSearchRelationship::RELATIONSHIP_AUTHOR, 20 + $task->getAuthorPHID(), 21 + PhabricatorPeopleUserPHIDType::TYPECONST, 22 + $task->getDateCreated()); 23 + 24 + $document->addRelationship( 25 + $task->isClosed() 26 + ? PhabricatorSearchRelationship::RELATIONSHIP_CLOSED 27 + : PhabricatorSearchRelationship::RELATIONSHIP_OPEN, 28 + $task->getPHID(), 29 + ManiphestTaskPHIDType::TYPECONST, 30 + PhabricatorTime::getNow()); 31 + 32 + $owner = $task->getOwnerPHID(); 33 + if ($owner) { 34 + $document->addRelationship( 35 + PhabricatorSearchRelationship::RELATIONSHIP_OWNER, 36 + $owner, 37 + PhabricatorPeopleUserPHIDType::TYPECONST, 38 + time()); 39 + } else { 40 + $document->addRelationship( 41 + PhabricatorSearchRelationship::RELATIONSHIP_UNOWNED, 42 + $task->getPHID(), 43 + PhabricatorPHIDConstants::PHID_TYPE_VOID, 44 + $task->getDateCreated()); 45 + } 46 + } 47 + 48 + }
+10 -1
src/applications/maniphest/storage/ManiphestTask.php
··· 14 14 PhabricatorApplicationTransactionInterface, 15 15 PhabricatorProjectInterface, 16 16 PhabricatorSpacesInterface, 17 - PhabricatorConduitResultInterface { 17 + PhabricatorConduitResultInterface, 18 + PhabricatorFulltextInterface { 18 19 19 20 const MARKUP_FIELD_DESCRIPTION = 'markup:desc'; 20 21 ··· 450 451 451 452 public function getConduitSearchAttachments() { 452 453 return array(); 454 + } 455 + 456 + 457 + /* -( PhabricatorFulltextInterface )--------------------------------------- */ 458 + 459 + 460 + public function newFulltextEngine() { 461 + return new ManiphestTaskFulltextEngine(); 453 462 } 454 463 455 464 }
+27
src/applications/passphrase/search/PassphraseCredentialFulltextEngine.php
··· 1 + <?php 2 + 3 + final class PassphraseCredentialFulltextEngine 4 + extends PhabricatorFulltextEngine { 5 + 6 + protected function buildAbstractDocument( 7 + PhabricatorSearchAbstractDocument $document, 8 + $object) { 9 + 10 + $credential = $object; 11 + 12 + $document->setDocumentTitle($credential->getName()); 13 + 14 + $document->addField( 15 + PhabricatorSearchDocumentFieldType::FIELD_BODY, 16 + $credential->getDescription()); 17 + 18 + $document->addRelationship( 19 + $credential->getIsDestroyed() 20 + ? PhabricatorSearchRelationship::RELATIONSHIP_CLOSED 21 + : PhabricatorSearchRelationship::RELATIONSHIP_OPEN, 22 + $credential->getPHID(), 23 + PassphraseCredentialPHIDType::TYPECONST, 24 + PhabricatorTime::getNow()); 25 + } 26 + 27 + }
-34
src/applications/passphrase/search/PassphraseSearchIndexer.php
··· 1 - <?php 2 - 3 - final class PassphraseSearchIndexer extends PhabricatorSearchDocumentIndexer { 4 - 5 - public function getIndexableObject() { 6 - return new PassphraseCredential(); 7 - } 8 - 9 - protected function buildAbstractDocumentByPHID($phid) { 10 - $credential = $this->loadDocumentByPHID($phid); 11 - 12 - $doc = new PhabricatorSearchAbstractDocument(); 13 - $doc->setPHID($credential->getPHID()); 14 - $doc->setDocumentType(PassphraseCredentialPHIDType::TYPECONST); 15 - $doc->setDocumentTitle($credential->getName()); 16 - $doc->setDocumentCreated($credential->getDateCreated()); 17 - $doc->setDocumentModified($credential->getDateModified()); 18 - 19 - $doc->addField( 20 - PhabricatorSearchDocumentFieldType::FIELD_BODY, 21 - $credential->getDescription()); 22 - 23 - $doc->addRelationship( 24 - $credential->getIsDestroyed() 25 - ? PhabricatorSearchRelationship::RELATIONSHIP_CLOSED 26 - : PhabricatorSearchRelationship::RELATIONSHIP_OPEN, 27 - $credential->getPHID(), 28 - PassphraseCredentialPHIDType::TYPECONST, 29 - time()); 30 - 31 - return $doc; 32 - } 33 - 34 - }
+11 -1
src/applications/passphrase/storage/PassphraseCredential.php
··· 7 7 PhabricatorFlaggableInterface, 8 8 PhabricatorSubscribableInterface, 9 9 PhabricatorDestructibleInterface, 10 - PhabricatorSpacesInterface { 10 + PhabricatorSpacesInterface, 11 + PhabricatorFulltextInterface { 11 12 12 13 protected $name; 13 14 protected $credentialType; ··· 188 189 public function getSpacePHID() { 189 190 return $this->spacePHID; 190 191 } 192 + 193 + 194 + /* -( PhabricatorFulltextInterface )--------------------------------------- */ 195 + 196 + 197 + public function newFulltextEngine() { 198 + return new PassphraseCredentialFulltextEngine(); 199 + } 200 + 191 201 192 202 }
+22
src/applications/people/search/PhabricatorUserFulltextEngine.php
··· 1 + <?php 2 + 3 + final class PhabricatorUserFulltextEngine 4 + extends PhabricatorFulltextEngine { 5 + 6 + protected function buildAbstractDocument( 7 + PhabricatorSearchAbstractDocument $document, 8 + $object) { 9 + 10 + $user = $object; 11 + 12 + $document->setDocumentTitle($user->getFullName()); 13 + 14 + $document->addRelationship( 15 + $user->isUserActivated() 16 + ? PhabricatorSearchRelationship::RELATIONSHIP_OPEN 17 + : PhabricatorSearchRelationship::RELATIONSHIP_CLOSED, 18 + $user->getPHID(), 19 + PhabricatorPeopleUserPHIDType::TYPECONST, 20 + PhabricatorTime::getNow()); 21 + } 22 + }
-30
src/applications/people/search/PhabricatorUserSearchIndexer.php
··· 1 - <?php 2 - 3 - final class PhabricatorUserSearchIndexer 4 - extends PhabricatorSearchDocumentIndexer { 5 - 6 - public function getIndexableObject() { 7 - return new PhabricatorUser(); 8 - } 9 - 10 - protected function buildAbstractDocumentByPHID($phid) { 11 - $user = $this->loadDocumentByPHID($phid); 12 - 13 - $doc = new PhabricatorSearchAbstractDocument(); 14 - $doc->setPHID($user->getPHID()); 15 - $doc->setDocumentType(PhabricatorPeopleUserPHIDType::TYPECONST); 16 - $doc->setDocumentTitle($user->getFullName()); 17 - $doc->setDocumentCreated($user->getDateCreated()); 18 - $doc->setDocumentModified($user->getDateModified()); 19 - 20 - $doc->addRelationship( 21 - $user->isUserActivated() 22 - ? PhabricatorSearchRelationship::RELATIONSHIP_OPEN 23 - : PhabricatorSearchRelationship::RELATIONSHIP_CLOSED, 24 - $user->getPHID(), 25 - PhabricatorPeopleUserPHIDType::TYPECONST, 26 - time()); 27 - 28 - return $doc; 29 - } 30 - }
+10 -1
src/applications/people/storage/PhabricatorUser.php
··· 15 15 PhabricatorDestructibleInterface, 16 16 PhabricatorSSHPublicKeyInterface, 17 17 PhabricatorFlaggableInterface, 18 - PhabricatorApplicationTransactionInterface { 18 + PhabricatorApplicationTransactionInterface, 19 + PhabricatorFulltextInterface { 19 20 20 21 const SESSION_TABLE = 'phabricator_session'; 21 22 const NAMETOKEN_TABLE = 'user_nametoken'; ··· 1306 1307 PhabricatorApplicationTransactionView $timeline, 1307 1308 AphrontRequest $request) { 1308 1309 return $timeline; 1310 + } 1311 + 1312 + 1313 + /* -( PhabricatorFulltextInterface )--------------------------------------- */ 1314 + 1315 + 1316 + public function newFulltextEngine() { 1317 + return new PhabricatorUserFulltextEngine(); 1309 1318 } 1310 1319 1311 1320 }
+25
src/applications/pholio/search/PholioMockFulltextEngine.php
··· 1 + <?php 2 + 3 + final class PholioMockFulltextEngine 4 + extends PhabricatorFulltextEngine { 5 + 6 + protected function buildAbstractDocument( 7 + PhabricatorSearchAbstractDocument $document, 8 + $object) { 9 + 10 + $mock = $object; 11 + 12 + $document->setDocumentTitle($mock->getName()); 13 + 14 + $document->addField( 15 + PhabricatorSearchDocumentFieldType::FIELD_BODY, 16 + $mock->getDescription()); 17 + 18 + $document->addRelationship( 19 + PhabricatorSearchRelationship::RELATIONSHIP_AUTHOR, 20 + $mock->getAuthorPHID(), 21 + PhabricatorPeopleUserPHIDType::TYPECONST, 22 + $mock->getDateCreated()); 23 + } 24 + 25 + }
-30
src/applications/pholio/search/PholioSearchIndexer.php
··· 1 - <?php 2 - 3 - final class PholioSearchIndexer extends PhabricatorSearchDocumentIndexer { 4 - 5 - public function getIndexableObject() { 6 - return new PholioMock(); 7 - } 8 - 9 - protected function buildAbstractDocumentByPHID($phid) { 10 - $mock = $this->loadDocumentByPHID($phid); 11 - 12 - $doc = $this->newDocument($phid) 13 - ->setDocumentTitle($mock->getName()) 14 - ->setDocumentCreated($mock->getDateCreated()) 15 - ->setDocumentModified($mock->getDateModified()); 16 - 17 - $doc->addField( 18 - PhabricatorSearchDocumentFieldType::FIELD_BODY, 19 - $mock->getDescription()); 20 - 21 - $doc->addRelationship( 22 - PhabricatorSearchRelationship::RELATIONSHIP_AUTHOR, 23 - $mock->getAuthorPHID(), 24 - PhabricatorPeopleUserPHIDType::TYPECONST, 25 - $mock->getDateCreated()); 26 - 27 - return $doc; 28 - } 29 - 30 - }
+10 -1
src/applications/pholio/storage/PholioMock.php
··· 11 11 PhabricatorProjectInterface, 12 12 PhabricatorDestructibleInterface, 13 13 PhabricatorSpacesInterface, 14 - PhabricatorMentionableInterface { 14 + PhabricatorMentionableInterface, 15 + PhabricatorFulltextInterface { 15 16 16 17 const MARKUP_FIELD_DESCRIPTION = 'markup:description'; 17 18 ··· 318 319 319 320 public function getSpacePHID() { 320 321 return $this->spacePHID; 322 + } 323 + 324 + 325 + /* -( PhabricatorFulltextInterface )--------------------------------------- */ 326 + 327 + 328 + public function newFulltextEngine() { 329 + return new PholioMockFulltextEngine(); 321 330 } 322 331 323 332
+44
src/applications/phriction/search/PhrictionDocumentFulltextEngine.php
··· 1 + <?php 2 + 3 + final class PhrictionDocumentFulltextEngine 4 + extends PhabricatorFulltextEngine { 5 + 6 + protected function buildAbstractDocument( 7 + PhabricatorSearchAbstractDocument $document, 8 + $object) { 9 + 10 + $wiki = id(new PhrictionDocumentQuery()) 11 + ->setViewer($this->getViewer()) 12 + ->withPHIDs(array($document->getPHID())) 13 + ->needContent(true) 14 + ->executeOne(); 15 + 16 + $content = $wiki->getContent(); 17 + 18 + $document->setDocumentTitle($content->getTitle()); 19 + 20 + // TODO: These are not quite correct, but we don't currently store the 21 + // proper dates in a way that's easy to get to. 22 + $document 23 + ->setDocumentCreated($content->getDateCreated()) 24 + ->setDocumentModified($content->getDateModified()); 25 + 26 + $document->addField( 27 + PhabricatorSearchDocumentFieldType::FIELD_BODY, 28 + $content->getContent()); 29 + 30 + $document->addRelationship( 31 + PhabricatorSearchRelationship::RELATIONSHIP_AUTHOR, 32 + $content->getAuthorPHID(), 33 + PhabricatorPeopleUserPHIDType::TYPECONST, 34 + $content->getDateCreated()); 35 + 36 + $document->addRelationship( 37 + ($wiki->getStatus() == PhrictionDocumentStatus::STATUS_EXISTS) 38 + ? PhabricatorSearchRelationship::RELATIONSHIP_OPEN 39 + : PhabricatorSearchRelationship::RELATIONSHIP_CLOSED, 40 + $wiki->getPHID(), 41 + PhrictionDocumentPHIDType::TYPECONST, 42 + PhabricatorTime::getNow()); 43 + } 44 + }
-47
src/applications/phriction/search/PhrictionSearchIndexer.php
··· 1 - <?php 2 - 3 - final class PhrictionSearchIndexer 4 - extends PhabricatorSearchDocumentIndexer { 5 - 6 - public function getIndexableObject() { 7 - return new PhrictionDocument(); 8 - } 9 - 10 - protected function buildAbstractDocumentByPHID($phid) { 11 - $document = $this->loadDocumentByPHID($phid); 12 - 13 - $content = id(new PhrictionContent())->load($document->getContentID()); 14 - $document->attachContent($content); 15 - 16 - $content = $document->getContent(); 17 - 18 - $doc = new PhabricatorSearchAbstractDocument(); 19 - $doc->setPHID($document->getPHID()); 20 - $doc->setDocumentType(PhrictionDocumentPHIDType::TYPECONST); 21 - $doc->setDocumentTitle($content->getTitle()); 22 - 23 - // TODO: This isn't precisely correct, denormalize into the Document table? 24 - $doc->setDocumentCreated($content->getDateCreated()); 25 - $doc->setDocumentModified($content->getDateModified()); 26 - 27 - $doc->addField( 28 - PhabricatorSearchDocumentFieldType::FIELD_BODY, 29 - $content->getContent()); 30 - 31 - $doc->addRelationship( 32 - PhabricatorSearchRelationship::RELATIONSHIP_AUTHOR, 33 - $content->getAuthorPHID(), 34 - PhabricatorPeopleUserPHIDType::TYPECONST, 35 - $content->getDateCreated()); 36 - 37 - $doc->addRelationship( 38 - ($document->getStatus() == PhrictionDocumentStatus::STATUS_EXISTS) 39 - ? PhabricatorSearchRelationship::RELATIONSHIP_OPEN 40 - : PhabricatorSearchRelationship::RELATIONSHIP_CLOSED, 41 - $document->getPHID(), 42 - PhrictionDocumentPHIDType::TYPECONST, 43 - time()); 44 - 45 - return $doc; 46 - } 47 - }
+10 -1
src/applications/phriction/storage/PhrictionDocument.php
··· 7 7 PhabricatorFlaggableInterface, 8 8 PhabricatorTokenReceiverInterface, 9 9 PhabricatorDestructibleInterface, 10 - PhabricatorApplicationTransactionInterface { 10 + PhabricatorApplicationTransactionInterface, 11 + PhabricatorFulltextInterface { 11 12 12 13 protected $slug; 13 14 protected $depth; ··· 250 251 } 251 252 252 253 $this->saveTransaction(); 254 + } 255 + 256 + 257 + /* -( PhabricatorFulltextInterface )--------------------------------------- */ 258 + 259 + 260 + public function newFulltextEngine() { 261 + return new PhrictionDocumentFulltextEngine(); 253 262 } 254 263 255 264 }
+24
src/applications/ponder/search/PonderQuestionFulltextEngine.php
··· 1 + <?php 2 + 3 + final class PonderQuestionFulltextEngine 4 + extends PhabricatorFulltextEngine { 5 + 6 + protected function buildAbstractDocument( 7 + PhabricatorSearchAbstractDocument $document, 8 + $object) { 9 + 10 + $question = $object; 11 + 12 + $document->setDocumentTitle($question->getTitle()); 13 + 14 + $document->addField( 15 + PhabricatorSearchDocumentFieldType::FIELD_BODY, 16 + $question->getContent()); 17 + 18 + $document->addRelationship( 19 + PhabricatorSearchRelationship::RELATIONSHIP_AUTHOR, 20 + $question->getAuthorPHID(), 21 + PhabricatorPeopleUserPHIDType::TYPECONST, 22 + $question->getDateCreated()); 23 + } 24 + }
-42
src/applications/ponder/search/PonderSearchIndexer.php
··· 1 - <?php 2 - 3 - final class PonderSearchIndexer 4 - extends PhabricatorSearchDocumentIndexer { 5 - 6 - public function getIndexableObject() { 7 - return new PonderQuestion(); 8 - } 9 - 10 - protected function buildAbstractDocumentByPHID($phid) { 11 - $question = $this->loadDocumentByPHID($phid); 12 - 13 - $doc = $this->newDocument($phid) 14 - ->setDocumentTitle($question->getTitle()) 15 - ->setDocumentCreated($question->getDateCreated()) 16 - ->setDocumentModified($question->getDateModified()); 17 - 18 - $doc->addField( 19 - PhabricatorSearchDocumentFieldType::FIELD_BODY, 20 - $question->getContent()); 21 - 22 - $doc->addRelationship( 23 - PhabricatorSearchRelationship::RELATIONSHIP_AUTHOR, 24 - $question->getAuthorPHID(), 25 - PhabricatorPeopleUserPHIDType::TYPECONST, 26 - $question->getDateCreated()); 27 - 28 - $answers = id(new PonderAnswerQuery()) 29 - ->setViewer($this->getViewer()) 30 - ->withQuestionIDs(array($question->getID())) 31 - ->execute(); 32 - foreach ($answers as $answer) { 33 - if (strlen($answer->getContent())) { 34 - $doc->addField( 35 - PhabricatorSearchDocumentFieldType::FIELD_COMMENT, 36 - $answer->getContent()); 37 - } 38 - } 39 - 40 - return $doc; 41 - } 42 - }
+10 -1
src/applications/ponder/storage/PonderQuestion.php
··· 10 10 PhabricatorTokenReceiverInterface, 11 11 PhabricatorProjectInterface, 12 12 PhabricatorDestructibleInterface, 13 - PhabricatorSpacesInterface { 13 + PhabricatorSpacesInterface, 14 + PhabricatorFulltextInterface { 14 15 15 16 const MARKUP_FIELD_CONTENT = 'markup:content'; 16 17 ··· 289 290 290 291 public function getSpacePHID() { 291 292 return $this->spacePHID; 293 + } 294 + 295 + 296 + /* -( PhabricatorFulltextInterface )--------------------------------------- */ 297 + 298 + 299 + public function newFulltextEngine() { 300 + return new PonderQuestionFulltextEngine(); 292 301 } 293 302 294 303 }
+24
src/applications/project/search/PhabricatorProjectFulltextEngine.php
··· 1 + <?php 2 + 3 + final class PhabricatorProjectFulltextEngine 4 + extends PhabricatorFulltextEngine { 5 + 6 + protected function buildAbstractDocument( 7 + PhabricatorSearchAbstractDocument $document, 8 + $object) { 9 + 10 + $project = $object; 11 + $project->updateDatasourceTokens(); 12 + 13 + $document->setDocumentTitle($project->getName()); 14 + 15 + $document->addRelationship( 16 + $project->isArchived() 17 + ? PhabricatorSearchRelationship::RELATIONSHIP_CLOSED 18 + : PhabricatorSearchRelationship::RELATIONSHIP_OPEN, 19 + $project->getPHID(), 20 + PhabricatorProjectProjectPHIDType::TYPECONST, 21 + PhabricatorTime::getNow()); 22 + } 23 + 24 + }
-35
src/applications/project/search/PhabricatorProjectSearchIndexer.php
··· 1 - <?php 2 - 3 - final class PhabricatorProjectSearchIndexer 4 - extends PhabricatorSearchDocumentIndexer { 5 - 6 - public function getIndexableObject() { 7 - return new PhabricatorProject(); 8 - } 9 - 10 - protected function buildAbstractDocumentByPHID($phid) { 11 - $project = $this->loadDocumentByPHID($phid); 12 - $project->updateDatasourceTokens(); 13 - 14 - $doc = new PhabricatorSearchAbstractDocument(); 15 - $doc->setPHID($project->getPHID()); 16 - $doc->setDocumentType(PhabricatorProjectProjectPHIDType::TYPECONST); 17 - $doc->setDocumentTitle($project->getName()); 18 - $doc->setDocumentCreated($project->getDateCreated()); 19 - $doc->setDocumentModified($project->getDateModified()); 20 - 21 - $doc->addRelationship( 22 - $project->isArchived() 23 - ? PhabricatorSearchRelationship::RELATIONSHIP_CLOSED 24 - : PhabricatorSearchRelationship::RELATIONSHIP_OPEN, 25 - $project->getPHID(), 26 - PhabricatorProjectProjectPHIDType::TYPECONST, 27 - time()); 28 - 29 - // NOTE: This could be more full-featured, but for now we're mostly 30 - // interested in the side effects of indexing. 31 - 32 - return $doc; 33 - } 34 - 35 - }
+11 -1
src/applications/project/storage/PhabricatorProject.php
··· 7 7 PhabricatorPolicyInterface, 8 8 PhabricatorSubscribableInterface, 9 9 PhabricatorCustomFieldInterface, 10 - PhabricatorDestructibleInterface { 10 + PhabricatorDestructibleInterface, 11 + PhabricatorFulltextInterface { 11 12 12 13 protected $name; 13 14 protected $status = PhabricatorProjectStatus::STATUS_ACTIVE; ··· 387 388 388 389 /* -( PhabricatorDestructibleInterface )----------------------------------- */ 389 390 391 + 390 392 public function destroyObjectPermanently( 391 393 PhabricatorDestructionEngine $engine) { 392 394 ··· 406 408 } 407 409 408 410 $this->saveTransaction(); 411 + } 412 + 413 + 414 + /* -( PhabricatorFulltextInterface )--------------------------------------- */ 415 + 416 + 417 + public function newFulltextEngine() { 418 + return new PhabricatorProjectFulltextEngine(); 409 419 } 410 420 411 421 }
+49
src/applications/repository/search/DiffusionCommitFulltextEngine.php
··· 1 + <?php 2 + 3 + final class DiffusionCommitFulltextEngine 4 + extends PhabricatorFulltextEngine { 5 + 6 + protected function buildAbstractDocument( 7 + PhabricatorSearchAbstractDocument $document, 8 + $object) { 9 + 10 + $commit = id(new DiffusionCommitQuery()) 11 + ->setViewer($this->getViewer()) 12 + ->withPHIDs(array($object->getPHID())) 13 + ->needCommitData(true) 14 + ->executeOne(); 15 + 16 + $repository = $commit->getRepository(); 17 + $commit_data = $commit->getCommitData(); 18 + 19 + $date_created = $commit->getEpoch(); 20 + $commit_message = $commit_data->getCommitMessage(); 21 + $author_phid = $commit_data->getCommitDetail('authorPHID'); 22 + 23 + $title = 'r'.$repository->getCallsign().$commit->getCommitIdentifier(). 24 + ' '.$commit_data->getSummary(); 25 + 26 + $document 27 + ->setDocumentCreated($date_created) 28 + ->setDocumentModified($date_created) 29 + ->setDocumentTitle($title); 30 + 31 + $document->addField( 32 + PhabricatorSearchDocumentFieldType::FIELD_BODY, 33 + $commit_message); 34 + 35 + if ($author_phid) { 36 + $document->addRelationship( 37 + PhabricatorSearchRelationship::RELATIONSHIP_AUTHOR, 38 + $author_phid, 39 + PhabricatorPeopleUserPHIDType::TYPECONST, 40 + $date_created); 41 + } 42 + 43 + $document->addRelationship( 44 + PhabricatorSearchRelationship::RELATIONSHIP_REPOSITORY, 45 + $repository->getPHID(), 46 + PhabricatorRepositoryRepositoryPHIDType::TYPECONST, 47 + $date_created); 48 + } 49 + }
-58
src/applications/repository/search/PhabricatorRepositoryCommitSearchIndexer.php
··· 1 - <?php 2 - 3 - final class PhabricatorRepositoryCommitSearchIndexer 4 - extends PhabricatorSearchDocumentIndexer { 5 - 6 - public function getIndexableObject() { 7 - return new PhabricatorRepositoryCommit(); 8 - } 9 - 10 - protected function buildAbstractDocumentByPHID($phid) { 11 - $commit = $this->loadDocumentByPHID($phid); 12 - 13 - $commit_data = id(new PhabricatorRepositoryCommitData())->loadOneWhere( 14 - 'commitID = %d', 15 - $commit->getID()); 16 - $date_created = $commit->getEpoch(); 17 - $commit_message = $commit_data->getCommitMessage(); 18 - $author_phid = $commit_data->getCommitDetail('authorPHID'); 19 - 20 - $repository = id(new PhabricatorRepositoryQuery()) 21 - ->setViewer($this->getViewer()) 22 - ->withIDs(array($commit->getRepositoryID())) 23 - ->executeOne(); 24 - if (!$repository) { 25 - throw new Exception(pht('No such repository!')); 26 - } 27 - 28 - $title = 'r'.$repository->getCallsign().$commit->getCommitIdentifier(). 29 - ' '.$commit_data->getSummary(); 30 - 31 - $doc = new PhabricatorSearchAbstractDocument(); 32 - $doc->setPHID($commit->getPHID()); 33 - $doc->setDocumentType(PhabricatorRepositoryCommitPHIDType::TYPECONST); 34 - $doc->setDocumentCreated($date_created); 35 - $doc->setDocumentModified($date_created); 36 - $doc->setDocumentTitle($title); 37 - 38 - $doc->addField( 39 - PhabricatorSearchDocumentFieldType::FIELD_BODY, 40 - $commit_message); 41 - 42 - if ($author_phid) { 43 - $doc->addRelationship( 44 - PhabricatorSearchRelationship::RELATIONSHIP_AUTHOR, 45 - $author_phid, 46 - PhabricatorPeopleUserPHIDType::TYPECONST, 47 - $date_created); 48 - } 49 - 50 - $doc->addRelationship( 51 - PhabricatorSearchRelationship::RELATIONSHIP_REPOSITORY, 52 - $repository->getPHID(), 53 - PhabricatorRepositoryRepositoryPHIDType::TYPECONST, 54 - $date_created); 55 - 56 - return $doc; 57 - } 58 - }
+9 -1
src/applications/repository/storage/PhabricatorRepositoryCommit.php
··· 11 11 PhabricatorMentionableInterface, 12 12 HarbormasterBuildableInterface, 13 13 PhabricatorCustomFieldInterface, 14 - PhabricatorApplicationTransactionInterface { 14 + PhabricatorApplicationTransactionInterface, 15 + PhabricatorFulltextInterface { 15 16 16 17 protected $repositoryID; 17 18 protected $phid; ··· 435 436 } 436 437 437 438 return $timeline->setPathMap($path_map); 439 + } 440 + 441 + /* -( PhabricatorFulltextInterface )--------------------------------------- */ 442 + 443 + 444 + public function newFulltextEngine() { 445 + return new DiffusionCommitFulltextEngine(); 438 446 } 439 447 440 448 }
+30
src/applications/search/engineextension/PhabricatorFulltextIndexEngineExtension.php
··· 1 + <?php 2 + 3 + final class PhabricatorFulltextIndexEngineExtension 4 + extends PhabricatorIndexEngineExtension { 5 + 6 + const EXTENSIONKEY = 'fulltext'; 7 + 8 + public function getExtensionName() { 9 + return pht('Fulltext Engine'); 10 + } 11 + 12 + public function shouldIndexObject($object) { 13 + return ($object instanceof PhabricatorFulltextInterface); 14 + } 15 + 16 + public function indexObject( 17 + PhabricatorIndexEngine $engine, 18 + $object) { 19 + 20 + $engine = $object->newFulltextEngine(); 21 + if (!$engine) { 22 + return; 23 + } 24 + 25 + $engine->setObject($object); 26 + 27 + $engine->buildFulltextIndexes(); 28 + } 29 + 30 + }
+34
src/applications/search/engineextension/PhabricatorLiskFulltextEngineExtension.php
··· 1 + <?php 2 + 3 + final class PhabricatorLiskFulltextEngineExtension 4 + extends PhabricatorFulltextEngineExtension { 5 + 6 + const EXTENSIONKEY = 'lisk'; 7 + 8 + public function getExtensionName() { 9 + return pht('Lisk Builtin Properties'); 10 + } 11 + 12 + public function shouldIndexFulltextObject($object) { 13 + if (!($object instanceof PhabricatorLiskDAO)) { 14 + return false; 15 + } 16 + 17 + if (!$object->getConfigOption(LiskDAO::CONFIG_TIMESTAMPS)) { 18 + return false; 19 + } 20 + 21 + return true; 22 + } 23 + 24 + public function indexFulltextObject( 25 + $object, 26 + PhabricatorSearchAbstractDocument $document) { 27 + 28 + $document 29 + ->setDocumentCreated($object->getDateCreated()) 30 + ->setDocumentModified($object->getDateModified()); 31 + 32 + } 33 + 34 + }
+54
src/applications/search/index/PhabricatorFulltextEngine.php
··· 1 + <?php 2 + 3 + abstract class PhabricatorFulltextEngine 4 + extends Phobject { 5 + 6 + private $object; 7 + 8 + public function setObject($object) { 9 + $this->object = $object; 10 + return $this; 11 + } 12 + 13 + public function getObject() { 14 + return $this->object; 15 + } 16 + 17 + protected function getViewer() { 18 + return PhabricatorUser::getOmnipotentUser(); 19 + } 20 + 21 + abstract protected function buildAbstractDocument( 22 + PhabricatorSearchAbstractDocument $document, 23 + $object); 24 + 25 + final public function buildFulltextIndexes() { 26 + $object = $this->getObject(); 27 + 28 + $extensions = PhabricatorFulltextEngineExtension::getAllExtensions(); 29 + foreach ($extensions as $key => $extension) { 30 + if (!$extension->shouldIndexFulltextObject($object)) { 31 + unset($extensions[$key]); 32 + } 33 + } 34 + 35 + $document = $this->newAbstractDocument($object); 36 + 37 + $this->buildAbstractDocument($document, $object); 38 + 39 + foreach ($extensions as $extension) { 40 + $extension->indexFulltextObject($object, $document); 41 + } 42 + 43 + $storage_engine = PhabricatorSearchEngine::loadEngine(); 44 + $storage_engine->reindexAbstractDocument($document); 45 + } 46 + 47 + protected function newAbstractDocument($object) { 48 + $phid = $object->getPHID(); 49 + return id(new PhabricatorSearchAbstractDocument()) 50 + ->setPHID($phid) 51 + ->setDocumentType(phid_get_type($phid)); 52 + } 53 + 54 + }
-15
src/applications/search/index/PhabricatorIndexEngine.php
··· 96 96 return $extensions; 97 97 } 98 98 99 - public function indexDocumentByPHID($phid) { 100 - $indexers = id(new PhutilClassMapQuery()) 101 - ->setAncestorClass('PhabricatorSearchDocumentIndexer') 102 - ->execute(); 103 - 104 - foreach ($indexers as $indexer) { 105 - if ($indexer->shouldIndexDocumentByPHID($phid)) { 106 - $indexer->indexDocumentByPHID($phid); 107 - break; 108 - } 109 - } 110 - 111 - return $this; 112 - } 113 - 114 99 }
-65
src/applications/search/index/PhabricatorSearchDocumentIndexer.php
··· 1 - <?php 2 - 3 - abstract class PhabricatorSearchDocumentIndexer extends Phobject { 4 - 5 - abstract public function getIndexableObject(); 6 - abstract protected function buildAbstractDocumentByPHID($phid); 7 - 8 - protected function getViewer() { 9 - return PhabricatorUser::getOmnipotentUser(); 10 - } 11 - 12 - public function shouldIndexDocumentByPHID($phid) { 13 - $object = $this->getIndexableObject(); 14 - return (phid_get_type($phid) == phid_get_type($object->generatePHID())); 15 - } 16 - 17 - public function getIndexIterator() { 18 - $object = $this->getIndexableObject(); 19 - return new LiskMigrationIterator($object); 20 - } 21 - 22 - protected function loadDocumentByPHID($phid) { 23 - $object = id(new PhabricatorObjectQuery()) 24 - ->setViewer($this->getViewer()) 25 - ->withPHIDs(array($phid)) 26 - ->executeOne(); 27 - if (!$object) { 28 - throw new Exception(pht("Unable to load object by PHID '%s'!", $phid)); 29 - } 30 - return $object; 31 - } 32 - 33 - public function indexDocumentByPHID($phid) { 34 - $document = $this->buildAbstractDocumentByPHID($phid); 35 - if ($document === null) { 36 - // This indexer doesn't build a document index, so we're done. 37 - return $this; 38 - } 39 - 40 - $object = $this->loadDocumentByPHID($phid); 41 - 42 - $extensions = PhabricatorFulltextEngineExtension::getAllExtensions(); 43 - foreach ($extensions as $key => $extension) { 44 - if (!$extension->shouldIndexFulltextObject($object)) { 45 - unset($extensions[$key]); 46 - } 47 - } 48 - 49 - foreach ($extensions as $extension) { 50 - $extension->indexFulltextObject($object, $document); 51 - } 52 - 53 - $engine = PhabricatorSearchEngine::loadEngine(); 54 - $engine->reindexAbstractDocument($document); 55 - 56 - return $this; 57 - } 58 - 59 - protected function newDocument($phid) { 60 - return id(new PhabricatorSearchAbstractDocument()) 61 - ->setPHID($phid) 62 - ->setDocumentType(phid_get_type($phid)); 63 - } 64 - 65 - }
+7
src/applications/search/interface/PhabricatorFulltextInterface.php
··· 1 + <?php 2 + 3 + interface PhabricatorFulltextInterface { 4 + 5 + public function newFulltextEngine(); 6 + 7 + }
+43 -12
src/applications/search/management/PhabricatorSearchManagementIndexWorkflow.php
··· 9 9 ->setSynopsis(pht('Build or rebuild search indexes.')) 10 10 ->setExamples( 11 11 "**index** D123\n". 12 - "**index** --type DREV\n". 12 + "**index** --type task\n". 13 13 "**index** --all") 14 14 ->setArguments( 15 15 array( ··· 19 19 ), 20 20 array( 21 21 'name' => 'type', 22 - 'param' => 'TYPE', 23 - 'help' => pht('PHID type to reindex, like "TASK" or "DREV".'), 22 + 'param' => 'type', 23 + 'help' => pht( 24 + 'Object types to reindex, like "task", "commit" or "revision".'), 24 25 ), 25 26 array( 26 27 'name' => 'background', ··· 146 147 } 147 148 148 149 private function loadPHIDsByTypes($type) { 149 - $indexers = id(new PhutilClassMapQuery()) 150 - ->setAncestorClass('PhabricatorSearchDocumentIndexer') 150 + $objects = id(new PhutilClassMapQuery()) 151 + ->setAncestorClass('PhabricatorFulltextInterface') 151 152 ->execute(); 152 153 153 - $phids = array(); 154 - foreach ($indexers as $indexer) { 155 - $indexer_phid = $indexer->getIndexableObject()->generatePHID(); 156 - $indexer_type = phid_get_type($indexer_phid); 154 + $normalized_type = phutil_utf8_strtolower($type); 157 155 158 - if ($type && strcasecmp($indexer_type, $type)) { 159 - continue; 156 + $matches = array(); 157 + foreach ($objects as $object) { 158 + $object_class = get_class($object); 159 + $normalized_class = phutil_utf8_strtolower($object_class); 160 + 161 + if (!strlen($type) || 162 + strpos($normalized_class, $normalized_type) !== false) { 163 + $matches[$object_class] = $object; 160 164 } 165 + } 161 166 162 - $iterator = $indexer->getIndexIterator(); 167 + if (!$matches) { 168 + $all_types = array(); 169 + foreach ($objects as $object) { 170 + $all_types[] = get_class($object); 171 + } 172 + sort($all_types); 173 + 174 + throw new PhutilArgumentUsageException( 175 + pht( 176 + 'Type "%s" matches no indexable objects. Supported types are: %s.', 177 + $type, 178 + implode(', ', $all_types))); 179 + } 180 + 181 + if ((count($matches) > 1) && strlen($type)) { 182 + throw new PhutilArgumentUsageException( 183 + pht( 184 + 'Type "%s" matches multiple indexable objects. Use a more '. 185 + 'specific string. Matching object types are: %s.', 186 + $type, 187 + implode(', ', array_keys($matches)))); 188 + } 189 + 190 + $phids = array(); 191 + foreach ($matches as $match) { 192 + $iterator = new LiskMigrationIterator($match); 163 193 foreach ($iterator as $object) { 164 194 $phids[] = $object->getPHID(); 165 195 } ··· 167 197 168 198 return $phids; 169 199 } 200 + 170 201 171 202 }
+11 -7
src/applications/search/query/PhabricatorSearchApplicationSearchEngine.php
··· 204 204 // TODO: This is inelegant and not very efficient, but gets us reasonable 205 205 // results. It would be nice to do this more elegantly. 206 206 207 - $indexers = id(new PhutilClassMapQuery()) 208 - ->setAncestorClass('PhabricatorSearchDocumentIndexer') 207 + $objects = id(new PhutilClassMapQuery()) 208 + ->setAncestorClass('PhabricatorFulltextInterface') 209 209 ->execute(); 210 210 211 + $type_map = array(); 212 + foreach ($objects as $object) { 213 + $phid_type = phid_get_type($object->generatePHID()); 214 + $type_map[$phid_type] = $object; 215 + } 216 + 211 217 if ($viewer) { 212 218 $types = PhabricatorPHIDType::getAllInstalledTypes($viewer); 213 219 } else { ··· 217 223 $results = array(); 218 224 foreach ($types as $type) { 219 225 $typeconst = $type->getTypeConstant(); 220 - foreach ($indexers as $indexer) { 221 - $fake_phid = 'PHID-'.$typeconst.'-fake'; 222 - if ($indexer->shouldIndexDocumentByPHID($fake_phid)) { 223 - $results[$typeconst] = $type->getTypeName(); 224 - } 226 + $object = idx($type_map, $typeconst); 227 + if ($object) { 228 + $results[$typeconst] = $type->getTypeName(); 225 229 } 226 230 } 227 231
-2
src/applications/search/worker/PhabricatorSearchWorker.php
··· 47 47 $engine->setObject($object); 48 48 49 49 $engine->indexObject(); 50 - 51 - $engine->indexDocumentByPHID($object->getPHID()); 52 50 } catch (Exception $ex) { 53 51 $lock->unlock(); 54 52