diff --git a/src/__phutil_library_map__.php b/src/__phutil_library_map__.php index 56fab4db41..d4164a52ae 100644 --- a/src/__phutil_library_map__.php +++ b/src/__phutil_library_map__.php @@ -1294,9 +1294,9 @@ phutil_register_library_map(array( 'ManiphestHovercardEventListener' => 'applications/maniphest/event/ManiphestHovercardEventListener.php', 'ManiphestInfoConduitAPIMethod' => 'applications/maniphest/conduit/ManiphestInfoConduitAPIMethod.php', 'ManiphestNameIndex' => 'applications/maniphest/storage/ManiphestNameIndex.php', - 'ManiphestNameIndexEventListener' => 'applications/maniphest/event/ManiphestNameIndexEventListener.php', 'ManiphestPriorityConfigOptionType' => 'applications/maniphest/config/ManiphestPriorityConfigOptionType.php', 'ManiphestPriorityEmailCommand' => 'applications/maniphest/command/ManiphestPriorityEmailCommand.php', + 'ManiphestProjectNameFulltextEngineExtension' => 'applications/maniphest/engineextension/ManiphestProjectNameFulltextEngineExtension.php', 'ManiphestQueryConduitAPIMethod' => 'applications/maniphest/conduit/ManiphestQueryConduitAPIMethod.php', 'ManiphestQueryStatusesConduitAPIMethod' => 'applications/maniphest/conduit/ManiphestQueryStatusesConduitAPIMethod.php', 'ManiphestRemarkupRule' => 'applications/maniphest/remarkup/ManiphestRemarkupRule.php', @@ -5338,9 +5338,9 @@ phutil_register_library_map(array( 'ManiphestHovercardEventListener' => 'PhabricatorEventListener', 'ManiphestInfoConduitAPIMethod' => 'ManiphestConduitAPIMethod', 'ManiphestNameIndex' => 'ManiphestDAO', - 'ManiphestNameIndexEventListener' => 'PhabricatorEventListener', 'ManiphestPriorityConfigOptionType' => 'PhabricatorConfigJSONOptionType', 'ManiphestPriorityEmailCommand' => 'ManiphestEmailCommand', + 'ManiphestProjectNameFulltextEngineExtension' => 'PhabricatorFulltextEngineExtension', 'ManiphestQueryConduitAPIMethod' => 'ManiphestConduitAPIMethod', 'ManiphestQueryStatusesConduitAPIMethod' => 'ManiphestConduitAPIMethod', 'ManiphestRemarkupRule' => 'PhabricatorObjectRemarkupRule', diff --git a/src/applications/maniphest/application/PhabricatorManiphestApplication.php b/src/applications/maniphest/application/PhabricatorManiphestApplication.php index 6e0419847c..a9c5ddcd01 100644 --- a/src/applications/maniphest/application/PhabricatorManiphestApplication.php +++ b/src/applications/maniphest/application/PhabricatorManiphestApplication.php @@ -38,7 +38,6 @@ final class PhabricatorManiphestApplication extends PhabricatorApplication { public function getEventListeners() { return array( - new ManiphestNameIndexEventListener(), new ManiphestHovercardEventListener(), ); } diff --git a/src/applications/maniphest/engineextension/ManiphestProjectNameFulltextEngineExtension.php b/src/applications/maniphest/engineextension/ManiphestProjectNameFulltextEngineExtension.php new file mode 100644 index 0000000000..32ee3fcab2 --- /dev/null +++ b/src/applications/maniphest/engineextension/ManiphestProjectNameFulltextEngineExtension.php @@ -0,0 +1,25 @@ +getPHID(), + $object->getName()); + } + +} diff --git a/src/applications/maniphest/event/ManiphestNameIndexEventListener.php b/src/applications/maniphest/event/ManiphestNameIndexEventListener.php deleted file mode 100644 index 15cb072f07..0000000000 --- a/src/applications/maniphest/event/ManiphestNameIndexEventListener.php +++ /dev/null @@ -1,25 +0,0 @@ -listen(PhabricatorEventType::TYPE_SEARCH_DIDUPDATEINDEX); - } - - public function handleEvent(PhutilEvent $event) { - $phid = $event->getValue('phid'); - $type = phid_get_type($phid); - - // For now, we only index projects. - if ($type != PhabricatorProjectProjectPHIDType::TYPECONST) { - return; - } - - $document = $event->getValue('document'); - - ManiphestNameIndex::updateIndex( - $phid, - $document->getDocumentTitle()); - } - -} diff --git a/src/applications/search/index/PhabricatorSearchDocumentIndexer.php b/src/applications/search/index/PhabricatorSearchDocumentIndexer.php index be2d38467a..164aa3effc 100644 --- a/src/applications/search/index/PhabricatorSearchDocumentIndexer.php +++ b/src/applications/search/index/PhabricatorSearchDocumentIndexer.php @@ -66,8 +66,6 @@ abstract class PhabricatorSearchDocumentIndexer extends Phobject { $engine = PhabricatorSearchEngine::loadEngine(); $engine->reindexAbstractDocument($document); - $this->dispatchDidUpdateIndexEvent($phid, $document); - return $this; } @@ -99,19 +97,4 @@ abstract class PhabricatorSearchDocumentIndexer extends Phobject { } } - private function dispatchDidUpdateIndexEvent( - $phid, - PhabricatorSearchAbstractDocument $document) { - - $event = new PhabricatorEvent( - PhabricatorEventType::TYPE_SEARCH_DIDUPDATEINDEX, - array( - 'phid' => $phid, - 'object' => $this->loadDocumentByPHID($phid), - 'document' => $document, - )); - $event->setUser($this->getViewer()); - PhutilEventEngine::dispatchEvent($event); - } - } diff --git a/src/docs/user/userguide/events.diviner b/src/docs/user/userguide/events.diviner index b0b22a02c1..dc9722a596 100644 --- a/src/docs/user/userguide/events.diviner +++ b/src/docs/user/userguide/events.diviner @@ -188,41 +188,6 @@ Data available on this event: Using @{class@libphutil:PhutilEmailAddress} may be helpful in parsing the query. -== Search: Did Update Index == - -The constant for this event is -`PhabricatorEventType::TYPE_SEARCH_DIDUPDATEINDEX`. - -This event is dispatched from the Search application's indexing engine, after -it indexes a document. It allows you to publish search-like indexes into other -systems. - -Note that this event happens after the update is fully complete: you can not -prevent or modify the update. Further, the event may fire significantly later -in real time than the update, as indexing may occur in the background. You -should use other events if you need guarantees about when the event executes. - -Finally, this event may fire more than once for a single update. For example, -if the search indexes are rebuilt, this event will fire on objects which have -not actually changed. - -So, good use cases for event listeners are: - - - Updating secondary search indexes. - -Bad use cases are: - - - Editing the object or document. - - Anything with side effects, like sending email. - -Data available on this event: - - - `phid` The PHID of the updated object. - - `object` The object which was updated (like a @{class:ManiphesTask}). - - `document` The @{class:PhabricatorSearchAbstractDocument} which was indexed. - This contains an abstract representation of the object, and may be useful - in populating secondary indexes because it provides a uniform API. - == Test: Did Run Test == The constant for this event is diff --git a/src/infrastructure/events/constant/PhabricatorEventType.php b/src/infrastructure/events/constant/PhabricatorEventType.php index 2a570cc823..64c58c11e5 100644 --- a/src/infrastructure/events/constant/PhabricatorEventType.php +++ b/src/infrastructure/events/constant/PhabricatorEventType.php @@ -27,6 +27,4 @@ final class PhabricatorEventType extends PhutilEventType { const TYPE_AUTH_WILLLOGINUSER = 'auth.willLoginUser'; const TYPE_AUTH_DIDVERIFYEMAIL = 'auth.didVerifyEmail'; - const TYPE_SEARCH_DIDUPDATEINDEX = 'search.didUpdateIndex'; - }