Correct a parameter order swap in "diffusion.historyquery" for Mercurial
[phabricator.git] / src / applications / phame / search / PhamePostFulltextEngine.php
blob4b41d5de7cd5492fb3a7c538a1c502b63a9b3249
1 <?php
3 final class PhamePostFulltextEngine
4 extends PhabricatorFulltextEngine {
6 protected function buildAbstractDocument(
7 PhabricatorSearchAbstractDocument $document,
8 $object) {
10 $post = $object;
12 $document->setDocumentTitle($post->getTitle());
14 $document->addField(
15 PhabricatorSearchDocumentFieldType::FIELD_BODY,
16 $post->getBody());
18 $document->addRelationship(
19 PhabricatorSearchRelationship::RELATIONSHIP_AUTHOR,
20 $post->getBloggerPHID(),
21 PhabricatorPeopleUserPHIDType::TYPECONST,
22 $post->getDateCreated());
24 $document->addRelationship(
25 $post->isArchived()
26 ? PhabricatorSearchRelationship::RELATIONSHIP_CLOSED
27 : PhabricatorSearchRelationship::RELATIONSHIP_OPEN,
28 $post->getPHID(),
29 PhabricatorPhamePostPHIDType::TYPECONST,
30 PhabricatorTime::getNow());