2015-06-04 23:27:48 +02:00
|
|
|
<?php
|
|
|
|
|
|
|
|
final class DivinerAtomSearchIndexer extends PhabricatorSearchDocumentIndexer {
|
|
|
|
|
|
|
|
public function getIndexableObject() {
|
|
|
|
return new DivinerLiveSymbol();
|
|
|
|
}
|
|
|
|
|
|
|
|
protected function buildAbstractDocumentByPHID($phid) {
|
|
|
|
$atom = $this->loadDocumentByPHID($phid);
|
|
|
|
$book = $atom->getBook();
|
|
|
|
|
|
|
|
$doc = $this->newDocument($phid)
|
|
|
|
->setDocumentTitle($atom->getTitle())
|
|
|
|
->setDocumentCreated($book->getDateCreated())
|
|
|
|
->setDocumentModified($book->getDateModified());
|
|
|
|
|
|
|
|
$doc->addField(
|
2015-06-05 20:01:25 +02:00
|
|
|
PhabricatorSearchDocumentFieldType::FIELD_BODY,
|
2015-06-04 23:27:48 +02:00
|
|
|
$atom->getSummary());
|
|
|
|
|
|
|
|
$doc->addRelationship(
|
|
|
|
PhabricatorSearchRelationship::RELATIONSHIP_BOOK,
|
|
|
|
$atom->getBookPHID(),
|
|
|
|
DivinerBookPHIDType::TYPECONST,
|
|
|
|
$book->getDateCreated());
|
|
|
|
|
|
|
|
return $doc;
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|