Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
freebsd
GitHub Repository: freebsd/phabricator
Path: blob/master/src/applications/diviner/search/DivinerLiveSymbolFulltextEngine.php
12256 views
1
<?php
2
3
final class DivinerLiveSymbolFulltextEngine
4
extends PhabricatorFulltextEngine {
5
6
protected function buildAbstractDocument(
7
PhabricatorSearchAbstractDocument $document,
8
$object) {
9
10
$atom = $object;
11
$book = $atom->getBook();
12
13
$document
14
->setDocumentTitle($atom->getTitle())
15
->setDocumentCreated($book->getDateCreated())
16
->setDocumentModified($book->getDateModified());
17
18
$document->addField(
19
PhabricatorSearchDocumentFieldType::FIELD_BODY,
20
$atom->getSummary());
21
22
$document->addRelationship(
23
PhabricatorSearchRelationship::RELATIONSHIP_BOOK,
24
$atom->getBookPHID(),
25
DivinerBookPHIDType::TYPECONST,
26
PhabricatorTime::getNow());
27
28
$document->addRelationship(
29
PhabricatorSearchRelationship::RELATIONSHIP_REPOSITORY,
30
$atom->getRepositoryPHID(),
31
PhabricatorRepositoryRepositoryPHIDType::TYPECONST,
32
PhabricatorTime::getNow());
33
34
$document->addRelationship(
35
$atom->getGraphHash()
36
? PhabricatorSearchRelationship::RELATIONSHIP_OPEN
37
: PhabricatorSearchRelationship::RELATIONSHIP_CLOSED,
38
$atom->getBookPHID(),
39
DivinerBookPHIDType::TYPECONST,
40
PhabricatorTime::getNow());
41
}
42
43
}
44
45