Remove all "FileHasObject" edge reads and writes
[phabricator.git] / src / applications / diviner / search / DivinerLiveSymbolFulltextEngine.php
blob80f3e0c0260b8699a855233bcc5691267afa28bf
1 <?php
3 final class DivinerLiveSymbolFulltextEngine
4 extends PhabricatorFulltextEngine {
6 protected function buildAbstractDocument(
7 PhabricatorSearchAbstractDocument $document,
8 $object) {
10 $atom = $object;
11 $book = $atom->getBook();
13 $document
14 ->setDocumentTitle($atom->getTitle())
15 ->setDocumentCreated($book->getDateCreated())
16 ->setDocumentModified($book->getDateModified());
18 $document->addField(
19 PhabricatorSearchDocumentFieldType::FIELD_BODY,
20 $atom->getSummary());
22 $document->addRelationship(
23 PhabricatorSearchRelationship::RELATIONSHIP_BOOK,
24 $atom->getBookPHID(),
25 DivinerBookPHIDType::TYPECONST,
26 PhabricatorTime::getNow());
28 $document->addRelationship(
29 PhabricatorSearchRelationship::RELATIONSHIP_REPOSITORY,
30 $atom->getRepositoryPHID(),
31 PhabricatorRepositoryRepositoryPHIDType::TYPECONST,
32 PhabricatorTime::getNow());
34 $document->addRelationship(
35 $atom->getGraphHash()
36 ? PhabricatorSearchRelationship::RELATIONSHIP_OPEN
37 : PhabricatorSearchRelationship::RELATIONSHIP_CLOSED,
38 $atom->getBookPHID(),
39 DivinerBookPHIDType::TYPECONST,
40 PhabricatorTime::getNow());