3 final class DiffusionCommitFulltextEngine
4 extends PhabricatorFulltextEngine
{
6 protected function buildAbstractDocument(
7 PhabricatorSearchAbstractDocument
$document,
10 $commit = id(new DiffusionCommitQuery())
11 ->setViewer($this->getViewer())
12 ->withPHIDs(array($object->getPHID()))
13 ->needCommitData(true)
16 $repository = $commit->getRepository();
17 $commit_data = $commit->getCommitData();
19 $date_created = $commit->getEpoch();
20 $commit_message = $commit_data->getCommitMessage();
21 $author_phid = $commit_data->getCommitDetail('authorPHID');
23 $monogram = $commit->getMonogram();
24 $summary = $commit_data->getSummary();
26 $title = "{$monogram} {$summary}";
29 ->setDocumentCreated($date_created)
30 ->setDocumentModified($date_created)
31 ->setDocumentTitle($title);
34 PhabricatorSearchDocumentFieldType
::FIELD_BODY
,
38 $document->addRelationship(
39 PhabricatorSearchRelationship
::RELATIONSHIP_AUTHOR
,
41 PhabricatorPeopleUserPHIDType
::TYPECONST
,
45 $document->addRelationship(
46 PhabricatorSearchRelationship
::RELATIONSHIP_REPOSITORY
,
47 $repository->getPHID(),
48 PhabricatorRepositoryRepositoryPHIDType
::TYPECONST
,
51 $document->addRelationship(
52 $commit->isUnreachable()
53 ? PhabricatorSearchRelationship
::RELATIONSHIP_CLOSED
54 : PhabricatorSearchRelationship
::RELATIONSHIP_OPEN
,
56 PhabricatorRepositoryCommitPHIDType
::TYPECONST
,
57 PhabricatorTime
::getNow());