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