2015-06-05 07:27:48 +10:00
|
|
|
<?php
|
|
|
|
|
2015-12-21 09:02:55 -08:00
|
|
|
final class DivinerLiveSymbolFulltextEngine
|
|
|
|
extends PhabricatorFulltextEngine {
|
2015-06-05 07:27:48 +10:00
|
|
|
|
2015-12-21 09:02:55 -08:00
|
|
|
protected function buildAbstractDocument(
|
|
|
|
PhabricatorSearchAbstractDocument $document,
|
|
|
|
$object) {
|
2015-06-05 07:27:48 +10:00
|
|
|
|
2015-12-21 09:02:55 -08:00
|
|
|
$atom = $object;
|
2015-06-05 07:27:48 +10:00
|
|
|
$book = $atom->getBook();
|
|
|
|
|
2015-12-21 09:02:55 -08:00
|
|
|
$document
|
2015-06-05 07:27:48 +10:00
|
|
|
->setDocumentTitle($atom->getTitle())
|
|
|
|
->setDocumentCreated($book->getDateCreated())
|
|
|
|
->setDocumentModified($book->getDateModified());
|
|
|
|
|
2015-12-21 09:02:55 -08:00
|
|
|
$document->addField(
|
2015-06-05 11:01:25 -07:00
|
|
|
PhabricatorSearchDocumentFieldType::FIELD_BODY,
|
2015-06-05 07:27:48 +10:00
|
|
|
$atom->getSummary());
|
|
|
|
|
2015-12-21 09:02:55 -08:00
|
|
|
$document->addRelationship(
|
2015-06-05 07:27:48 +10:00
|
|
|
PhabricatorSearchRelationship::RELATIONSHIP_BOOK,
|
|
|
|
$atom->getBookPHID(),
|
|
|
|
DivinerBookPHIDType::TYPECONST,
|
2015-06-17 07:28:16 +10:00
|
|
|
PhabricatorTime::getNow());
|
|
|
|
|
2015-12-21 09:02:55 -08:00
|
|
|
$document->addRelationship(
|
2015-06-19 17:24:23 +10:00
|
|
|
PhabricatorSearchRelationship::RELATIONSHIP_REPOSITORY,
|
|
|
|
$atom->getRepositoryPHID(),
|
|
|
|
PhabricatorRepositoryRepositoryPHIDType::TYPECONST,
|
|
|
|
PhabricatorTime::getNow());
|
|
|
|
|
2015-12-21 09:02:55 -08:00
|
|
|
$document->addRelationship(
|
2015-06-17 07:28:16 +10:00
|
|
|
$atom->getGraphHash()
|
2017-02-13 13:06:03 -08:00
|
|
|
? PhabricatorSearchRelationship::RELATIONSHIP_OPEN
|
|
|
|
: PhabricatorSearchRelationship::RELATIONSHIP_CLOSED,
|
2015-06-17 07:28:16 +10:00
|
|
|
$atom->getBookPHID(),
|
|
|
|
DivinerBookPHIDType::TYPECONST,
|
|
|
|
PhabricatorTime::getNow());
|
2015-06-05 07:27:48 +10:00
|
|
|
}
|
|
|
|
|
|
|
|
}
|