diff --git a/src/__phutil_library_map__.php b/src/__phutil_library_map__.php index 378b8c78a3..dcd03733a4 100644 --- a/src/__phutil_library_map__.php +++ b/src/__phutil_library_map__.php @@ -1473,6 +1473,7 @@ phutil_register_library_map(array( 'PhabricatorProjectProfileEditController' => 'applications/project/controller/PhabricatorProjectProfileEditController.php', 'PhabricatorProjectQuery' => 'applications/project/query/PhabricatorProjectQuery.php', 'PhabricatorProjectSearchEngine' => 'applications/project/query/PhabricatorProjectSearchEngine.php', + 'PhabricatorProjectSearchIndexer' => 'applications/project/search/PhabricatorProjectSearchIndexer.php', 'PhabricatorProjectStatus' => 'applications/project/constants/PhabricatorProjectStatus.php', 'PhabricatorProjectTestDataGenerator' => 'applications/project/lipsum/PhabricatorProjectTestDataGenerator.php', 'PhabricatorProjectTransaction' => 'applications/project/storage/PhabricatorProjectTransaction.php', @@ -3609,6 +3610,7 @@ phutil_register_library_map(array( 'PhabricatorProjectProfileEditController' => 'PhabricatorProjectController', 'PhabricatorProjectQuery' => 'PhabricatorCursorPagedPolicyAwareQuery', 'PhabricatorProjectSearchEngine' => 'PhabricatorApplicationSearchEngine', + 'PhabricatorProjectSearchIndexer' => 'PhabricatorSearchDocumentIndexer', 'PhabricatorProjectTestDataGenerator' => 'PhabricatorTestDataGenerator', 'PhabricatorProjectTransaction' => 'PhabricatorProjectDAO', 'PhabricatorProjectTransactionType' => 'PhabricatorProjectConstants', diff --git a/src/applications/project/search/PhabricatorProjectSearchIndexer.php b/src/applications/project/search/PhabricatorProjectSearchIndexer.php new file mode 100644 index 0000000000..f46796163f --- /dev/null +++ b/src/applications/project/search/PhabricatorProjectSearchIndexer.php @@ -0,0 +1,25 @@ +loadDocumentByPHID($phid); + + $doc = new PhabricatorSearchAbstractDocument(); + $doc->setPHID($project->getPHID()); + $doc->setDocumentType(PhabricatorProjectPHIDTypeProject::TYPECONST); + $doc->setDocumentTitle($project->getName()); + $doc->setDocumentCreated($project->getDateCreated()); + $doc->setDocumentModified($project->getDateModified()); + + // NOTE: This could be more full-featured, but for now we're mostly + // interested in the side effects of indexing. + + return $doc; + } +} diff --git a/src/applications/search/management/PhabricatorSearchManagementIndexWorkflow.php b/src/applications/search/management/PhabricatorSearchManagementIndexWorkflow.php index a41c06a2f3..eddc311d38 100644 --- a/src/applications/search/management/PhabricatorSearchManagementIndexWorkflow.php +++ b/src/applications/search/management/PhabricatorSearchManagementIndexWorkflow.php @@ -124,7 +124,7 @@ final class PhabricatorSearchManagementIndexWorkflow $indexer_phid = $indexer->getIndexableObject()->generatePHID(); $indexer_type = phid_get_type($indexer_phid); - if ($type && ($indexer_type != $type)) { + if ($type && strcasecmp($indexer_type, $type)) { continue; }