mirror of
https://we.phorge.it/source/phorge.git
synced 2024-11-29 02:02:41 +01:00
99c9df96b4
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
24 lines
622 B
PHP
24 lines
622 B
PHP
<?php
|
|
|
|
final class PhabricatorProjectFulltextEngine
|
|
extends PhabricatorFulltextEngine {
|
|
|
|
protected function buildAbstractDocument(
|
|
PhabricatorSearchAbstractDocument $document,
|
|
$object) {
|
|
|
|
$project = $object;
|
|
$project->updateDatasourceTokens();
|
|
|
|
$document->setDocumentTitle($project->getName());
|
|
|
|
$document->addRelationship(
|
|
$project->isArchived()
|
|
? PhabricatorSearchRelationship::RELATIONSHIP_CLOSED
|
|
: PhabricatorSearchRelationship::RELATIONSHIP_OPEN,
|
|
$project->getPHID(),
|
|
PhabricatorProjectProjectPHIDType::TYPECONST,
|
|
PhabricatorTime::getNow());
|
|
}
|
|
|
|
}
|