1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2025-02-26 21:49:08 +01:00
phorge-phorge/src/applications/phame/search/PhameBlogFulltextEngine.php
Chad Little cfa73eb544 Make PhameBlog full text searchable
Summary: Ref T9897, makes blogs searchable

Test Plan: Make a blog, index it, search for it.

Reviewers: epriestley

Reviewed By: epriestley

Subscribers: Korvin

Maniphest Tasks: T9897

Differential Revision: https://secure.phabricator.com/D16119
2016-06-14 13:13:22 -07:00

28 lines
669 B
PHP

<?php
final class PhameBlogFulltextEngine
extends PhabricatorFulltextEngine {
protected function buildAbstractDocument(
PhabricatorSearchAbstractDocument $document,
$object) {
$blog = $object;
$document->setDocumentTitle($blog->getName());
$document->addField(
PhabricatorSearchDocumentFieldType::FIELD_BODY,
$blog->getDescription());
$document->addRelationship(
$blog->isArchived()
? PhabricatorSearchRelationship::RELATIONSHIP_CLOSED
: PhabricatorSearchRelationship::RELATIONSHIP_OPEN,
$blog->getPHID(),
PhabricatorPhameBlogPHIDType::TYPECONST,
PhabricatorTime::getNow());
}
}