Path: blob/master/src/infrastructure/customfield/engineextension/PhabricatorCustomFieldFulltextEngineExtension.php
12242 views
<?php12final class PhabricatorCustomFieldFulltextEngineExtension3extends PhabricatorFulltextEngineExtension {45const EXTENSIONKEY = 'customfield.fields';67public function getExtensionName() {8return pht('Custom Fields');9}1011public function shouldEnrichFulltextObject($object) {12return ($object instanceof PhabricatorCustomFieldInterface);13}1415public function enrichFulltextObject(16$object,17PhabricatorSearchAbstractDocument $document) {1819// Rebuild the ApplicationSearch indexes. These are internal and not part20// of the fulltext search, but putting them in this workflow allows users21// to use the same tools to rebuild the indexes, which is easy to22// understand.2324$field_list = PhabricatorCustomField::getObjectFields(25$object,26PhabricatorCustomField::ROLE_DEFAULT);2728$field_list->setViewer($this->getViewer());29$field_list->readFieldsFromStorage($object);3031// Rebuild ApplicationSearch indexes.32$field_list->rebuildIndexes($object);3334// Rebuild global search indexes.35$field_list->updateAbstractDocument($document);36}3738}394041